From aaf01377c9fcc4ad6e1f67d38b7f7d0318420c18 Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Tue, 17 Jan 2023 15:45:34 +0100 Subject: [PATCH] Abstract make test-integration logic into separate bash file --- Makefile | 5 +---- test/integration/scripts/run-test-suites.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 test/integration/scripts/run-test-suites.sh diff --git a/Makefile b/Makefile index 8642502a4..456f3aa2a 100644 --- a/Makefile +++ b/Makefile @@ -140,10 +140,7 @@ test-unit: ## Run unit tests test-integration: $(GO_BIN)/commander ## Run integration tests. To run a specific test pass the FILTER var. Usage: `make test-integration FILTER="attack protection"` ${call print, "Running integration tests"} @$(MAKE) install # ensure fresh install prior to running test - auth0 login --domain ${AUTH0_CLI_CLIENT_DOMAIN} --client-id ${AUTH0_CLI_CLIENT_ID} --client-secret ${AUTH0_CLI_CLIENT_SECRET} && commander test ./test/integration/test-cases.yaml --filter "$(FILTER)"; \ - exit_code=$$?; \ - bash ./test/integration/scripts/test-cleanup.sh; \ - exit $$exit_code + @bash ./test/integration/scripts/run-test-suites.sh test-mocks: $(GO_BIN)/mockgen ## Generate testing mocks using mockgen ${call print, "Generating test mocks"} diff --git a/test/integration/scripts/run-test-suites.sh b/test/integration/scripts/run-test-suites.sh new file mode 100644 index 000000000..2c1161f06 --- /dev/null +++ b/test/integration/scripts/run-test-suites.sh @@ -0,0 +1,18 @@ +#! /bin/bash -v + +set -e + +auth0 login \ + --domain "${AUTH0_CLI_CLIENT_DOMAIN}" \ + --client-id "${AUTH0_CLI_CLIENT_ID}" \ + --client-secret "${AUTH0_CLI_CLIENT_SECRET}" + +set +e + +commander test --filter "$FILTER" --dir ./test/integration + +exit_code=$? + +bash ./test/integration/scripts/test-cleanup.sh + +exit $exit_code