From 1060abe48b809b626d92906fd02031cd8e15b5bf Mon Sep 17 00:00:00 2001 From: lumtis Date: Fri, 23 Feb 2024 14:32:19 +0100 Subject: [PATCH] add admin function test command --- Makefile | 9 +++++++-- contrib/localnet/docker-compose-admin.yml | 9 +++++++++ contrib/localnet/docker-compose-setup-only.yml | 2 +- contrib/localnet/orchestrator/start.sh | 18 ++---------------- 4 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 contrib/localnet/docker-compose-admin.yml diff --git a/Makefile b/Makefile index 3a1501c611..ab0605f928 100644 --- a/Makefile +++ b/Makefile @@ -193,11 +193,16 @@ install-zetae2e: go.sum @go install -mod=readonly $(BUILD_FLAGS) ./cmd/zetae2e .PHONY: install-zetae2e -start-e2e-test: +start-e2e-test: zetanode @echo "--> Starting e2e test" cd contrib/localnet/ && $(DOCKER) compose up -d +start-e2e-admin-test: zetanode + @echo "--> Starting e2e admin test" + cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-admin.yml up -d + start-stress-test: zetanode + @echo "--> Starting stress test" cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-stresstest.yml up -d start-upgrade-test: @@ -212,7 +217,7 @@ start-upgrade-test-light: $(DOCKER) build -t orchestrator -f contrib/localnet/orchestrator/Dockerfile.fastbuild . cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-upgrade-light.yml up -d -start-localnet: +start-localnet: zetanode @echo "--> Starting localnet" cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-setup-only.yml up -d diff --git a/contrib/localnet/docker-compose-admin.yml b/contrib/localnet/docker-compose-admin.yml new file mode 100644 index 0000000000..9ada20f51d --- /dev/null +++ b/contrib/localnet/docker-compose-admin.yml @@ -0,0 +1,9 @@ +version: "3" + +# This docker-compose file overrides the orcherstrator service to specify the flag to test the admin functions +# and skip the regular tests + +services: + orchestrator: + entrypoint: ["/work/start.sh", "local --skip-regular --test-admin"] + diff --git a/contrib/localnet/docker-compose-setup-only.yml b/contrib/localnet/docker-compose-setup-only.yml index c4d3dbb4c3..979f448527 100644 --- a/contrib/localnet/docker-compose-setup-only.yml +++ b/contrib/localnet/docker-compose-setup-only.yml @@ -5,5 +5,5 @@ version: "3" services: orchestrator: - entrypoint: ["/work/start.sh", "local", "setup-only"] + entrypoint: ["/work/start.sh", "local --setup-only"] diff --git a/contrib/localnet/orchestrator/start.sh b/contrib/localnet/orchestrator/start.sh index d5e49af490..bd31e8213c 100644 --- a/contrib/localnet/orchestrator/start.sh +++ b/contrib/localnet/orchestrator/start.sh @@ -92,27 +92,13 @@ if [ "$OPTION" == "upgrade" ]; then exit 1 fi -elif [ "$OPTION" == "setup-only" ]; then - - # Setup localnet with the --setup-only flag - - zetae2e "$ZETAE2E_CMD" --setup-only - - ZETAE2E_EXIT_CODE=$? - if [ $ZETAE2E_EXIT_CODE -eq 0 ]; then - echo "Localnet setup" - exit 0 - else - echo "Localnet failed to start" - exit 1 - fi - else # Run the e2e tests normally echo "running e2e tests..." - zetae2e "$ZETAE2E_CMD" + # zetae2e "$ZETAE2E_CMD" + eval "zetae2e $ZETAE2E_CMD" ZETAE2E_EXIT_CODE=$? # if e2e passed, exit with 0, otherwise exit with 1