Skip to content

Commit

Permalink
add admin function test command
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Feb 23, 2024
1 parent e137e48 commit 1060abe
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
9 changes: 9 additions & 0 deletions contrib/localnet/docker-compose-admin.yml
Original file line number Diff line number Diff line change
@@ -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"]

2 changes: 1 addition & 1 deletion contrib/localnet/docker-compose-setup-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ version: "3"

services:
orchestrator:
entrypoint: ["/work/start.sh", "local", "setup-only"]
entrypoint: ["/work/start.sh", "local --setup-only"]

18 changes: 2 additions & 16 deletions contrib/localnet/orchestrator/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1060abe

Please sign in to comment.