feat: add matrix tests for bats
This commit is contained in:
parent
832debbd45
commit
6ec3c65cd1
|
|
@ -19,12 +19,15 @@ on:
|
|||
- 'backup/**'
|
||||
- '*.md'
|
||||
|
||||
#TODO: create a matrix per earch bats file
|
||||
jobs:
|
||||
run-tests:
|
||||
if: github.event.pull_request.draft == false
|
||||
name: BATS Run tests
|
||||
name: BATS test {{ matrix.test-file }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test-file: ["1-deploy.bats", "2-deploy-with-more-options.bats", "3-deploy-with-webhook.bats"]
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
|
@ -61,4 +64,4 @@ jobs:
|
|||
- name: Jenkins Operator - bats tests
|
||||
env:
|
||||
BATS_LIB_PATH: "${{ github.workspace }}/.bats"
|
||||
run: make bats-tests
|
||||
run: BATS_TEST_PATH={{matrix.test-file}} make bats-tests
|
||||
|
|
|
|||
8
Makefile
8
Makefile
|
|
@ -383,21 +383,21 @@ kind-clean: ## Delete kind cluster
|
|||
kind delete cluster --name $(KIND_CLUSTER_NAME)
|
||||
|
||||
.PHONY: kind-revamp
|
||||
kind-revamp: kind-clean kind-setup## Delete and recreate kind cluster
|
||||
kind-revamp: kind-clean kind-setup ## Delete and recreate kind cluster
|
||||
@echo "+ $@"
|
||||
|
||||
.PHONY: bats-tests
|
||||
.PHONY: bats-tests ## Run bats tests
|
||||
IMAGE_NAME := quay.io/$(QUAY_ORGANIZATION)/$(QUAY_REGISTRY):$(GITCOMMIT)-amd64
|
||||
BUILD_PRESENT := $(shell docker images |grep -q ${IMAGE_NAME})
|
||||
ifndef BUILD_PRESENT
|
||||
bats-tests: backup-kind-load container-runtime-build-amd64 ## Run bats tests
|
||||
@echo "+ $@"
|
||||
kind load docker-image ${IMAGE_NAME} --name $(KIND_CLUSTER_NAME)
|
||||
OPERATOR_IMAGE="${IMAGE_NAME}" TERM=xterm bats -T -p test/bats
|
||||
OPERATOR_IMAGE="${IMAGE_NAME}" TERM=xterm bats -T -p test/bats$(if $(BATS_TEST_PATH),/${BATS_TEST_PATH})
|
||||
else
|
||||
bats-tests: backup-kind-load
|
||||
@echo "+ $@"
|
||||
OPERATOR_IMAGE="${IMAGE_NAME}" TERM=xterm bats -T -p test/bats
|
||||
OPERATOR_IMAGE="${IMAGE_NAME}" TERM=xterm bats -T -p test/bats$(if $(BATS_TEST_PATH),/${BATS_TEST_PATH})
|
||||
endif
|
||||
|
||||
.PHONY: crc-start
|
||||
|
|
|
|||
Loading…
Reference in New Issue