1
0
mirror of synced 2026-02-06 19:05:55 +00:00
Files
flux2/tests/integration/Makefile
Sunny 94c9b13fbd tests/int: Add separate resource cleanup step
Introduce a destroy-only mode in the test runner to run terraform
destroy for the respective cloud provider configurations. This can be
used to destroy cloud resources without going through the whole
provision-test process.

Add a new step in github actions workflow to run the test binary in
destoy-only mode at the very end irrespective of the result of the
previous steps. This ensures that the infrastructure is always
destroyed, even if the CI job is cancelled.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2024-01-09 03:22:13 +05:30

33 lines
896 B
Makefile

GO_TEST_ARGS ?=
PROVIDER_ARG ?=
TEST_TIMEOUT ?= 60m
FLUX_BINARY ?= ../../bin/flux
test: sops-check
mkdir -p build
cp $(FLUX_BINARY) build/flux
# These two versions of podinfo are pushed to the cloud registry and used in tests for ImageUpdateAutomation
docker pull ghcr.io/stefanprodan/podinfo:6.0.0
docker pull ghcr.io/stefanprodan/podinfo:6.0.1
go test -timeout $(TEST_TIMEOUT) -v ./ $(GO_TEST_ARGS) $(PROVIDER_ARG)
test-azure:
$(MAKE) test PROVIDER_ARG="-provider azure" GO_TEST_ARGS="--tags azure $(GO_TEST_ARGS)"
test-gcp:
$(MAKE) test PROVIDER_ARG="-provider gcp"
destroy:
go test -timeout $(TEST_TIMEOUT) -v ./ $(GO_TEST_ARGS) $(PROVIDER_ARG) -destroy-only
destroy-azure:
$(MAKE) destroy PROVIDER_ARG="-provider azure"
destroy-gcp:
$(MAKE) destroy PROVIDER_ARG="-provider gcp"
sops-check:
ifeq ($(shell which sops),)
$(error "no sops in PATH, consider installing")
endif