Skip to content

Commit

Permalink
Abstract make test-integration logic into separate bash file
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught committed Jan 17, 2023
1 parent 2f3682f commit aaf0137
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
18 changes: 18 additions & 0 deletions test/integration/scripts/run-test-suites.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit aaf0137

Please sign in to comment.