diff --git a/.github/workflows/execute_advanced_tests.yaml b/.github/workflows/execute_advanced_tests.yaml index 8d286fbdf0..0af6d13a48 100644 --- a/.github/workflows/execute_advanced_tests.yaml +++ b/.github/workflows/execute_advanced_tests.yaml @@ -134,4 +134,4 @@ jobs: - name: Full Log Dump On Failure if: failure() run: | - make stop-localnet \ No newline at end of file + make stop-localnet diff --git a/Makefile b/Makefile index fa99e6f80f..75834d690d 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,8 @@ TEST_BUILD_FLAGS := -tags pebbledb,ledger HSM_BUILD_FLAGS := -tags pebbledb,ledger,hsm_test export DOCKER_BUILDKIT := 1 + +# parameters for localnet docker compose files # set defaults to empty to prevent docker warning export LOCALNET_MODE export E2E_ARGS := $(E2E_ARGS) diff --git a/contrib/localnet/docker-compose-stress.yml b/contrib/localnet/docker-compose-stress.yml index 4f32b151ba..fb11f01b5c 100644 --- a/contrib/localnet/docker-compose-stress.yml +++ b/contrib/localnet/docker-compose-stress.yml @@ -70,4 +70,4 @@ services: - HOTKEY_PASSWORD=password # test purposes only volumes: - ssh:/root/.ssh - - preparams:/root/preparams \ No newline at end of file + - preparams:/root/preparams diff --git a/contrib/localnet/docker-compose-upgrade.yml b/contrib/localnet/docker-compose-upgrade.yml index 1febbbab59..c6ae72941a 100644 --- a/contrib/localnet/docker-compose-upgrade.yml +++ b/contrib/localnet/docker-compose-upgrade.yml @@ -42,4 +42,4 @@ services: environment: - UPGRADE_HEIGHT=${UPGRADE_HEIGHT} volumes: - - ssh:/root/.ssh \ No newline at end of file + - ssh:/root/.ssh diff --git a/contrib/localnet/scripts/import-data.sh b/contrib/localnet/scripts/import-data.sh index 3d53077d63..5236bfe166 100644 --- a/contrib/localnet/scripts/import-data.sh +++ b/contrib/localnet/scripts/import-data.sh @@ -12,4 +12,4 @@ mkdir ~/.zetacored/genesis_data echo "Download Latest State Export" LATEST_EXPORT_URL=$(curl https://snapshots.zetachain.com/latest-state-export | jq -r ."${NETWORK}") echo "LATEST EXPORT URL: ${LATEST_EXPORT_URL}" -wget -q ${LATEST_EXPORT_URL} -O ~/.zetacored/genesis_data/exported-genesis.json \ No newline at end of file +wget -q ${LATEST_EXPORT_URL} -O ~/.zetacored/genesis_data/exported-genesis.json diff --git a/docs/development/LOCAL_TESTING.md b/docs/development/LOCAL_TESTING.md index d28c44638e..3472daca89 100644 --- a/docs/development/LOCAL_TESTING.md +++ b/docs/development/LOCAL_TESTING.md @@ -27,6 +27,17 @@ Now we have built all the docker images, we can run the e2e test with make comma make start-e2e-test ``` +This uses `docker compose` to start the localnet and run standard e2e tests inside the orchestrator container. There are several parameters that the `Makefile` can provide to `docker compose` via environment variables: + +- `LOCALNET_MODE` + - `setup-only`: only setup the localnet, do not run the e2e tests + - `upgrade`: run the upgrade tests + - unset: run the e2e tests +- `E2E_ARGS`: arguments to provide to the `zetae2e local` command +- `UPGRADE_HEIGHT`: block height to upgrade at when `LOCALNET_MODE=upgrade` +- `ZETACORED_IMPORT_GENESIS_DATA`: path to genesis data to import before starting zetacored +- `ZETACORED_START_PERIOD`: duration to tolerate `zetacored` health check failures during startup + #### Run admin functions e2e tests We define e2e tests allowing to test admin functionalities (emergency network pause for example). @@ -42,13 +53,7 @@ make start-e2e-admin-test Upgrade tests run the E2E tests with an older version, upgrade the nodes to the new version, and run the E2E tests again. This allows testing the upgrade process with a populated state. -Before running the upgrade tests, the versions must be specified in `Dockefile-upgrade`: - -```dockerfile -ARG OLD_VERSION=v{old_major_version}.{old_minor_version}.{old_patch_version} -ENV NEW_VERSION=v{new_major_version} -``` -The new version must match the version specified in `app/setup_handlers.go` +Before running the upgrade tests, the old version must be specified the Makefile. NOTE: We only specify the major version for `NEW_VERSION` since we use major version only for chain upgrade. Semver is needed for `OLD_VERSION` because we use this value to fetch the release tag from the GitHub repository.