From 8efbf3c92c8dd581166adf72e644b5df7d72548e Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Tue, 13 Aug 2024 10:17:27 -0700 Subject: [PATCH] fix(e2e): skip tracker check in upgrade tests (#2688) * set OLD_VERSION before running e2e to tolerate missed upgrade height * add skip-tracker-check arg --- cmd/zetae2e/local/local.go | 7 ++++++- contrib/localnet/orchestrator/start-zetae2e.sh | 13 ++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cmd/zetae2e/local/local.go b/cmd/zetae2e/local/local.go index cb24096859..86adfac7c4 100644 --- a/cmd/zetae2e/local/local.go +++ b/cmd/zetae2e/local/local.go @@ -41,6 +41,7 @@ const ( flagTestTSSMigration = "test-tss-migration" flagSkipBitcoinSetup = "skip-bitcoin-setup" flagSkipHeaderProof = "skip-header-proof" + flagSkipTrackerCheck = "skip-tracker-check" ) var ( @@ -73,6 +74,7 @@ func NewLocalCmd() *cobra.Command { cmd.Flags().Bool(flagSkipBitcoinSetup, false, "set to true to skip bitcoin wallet setup") cmd.Flags().Bool(flagSkipHeaderProof, false, "set to true to skip header proof tests") cmd.Flags().Bool(flagTestTSSMigration, false, "set to true to include a migration test at the end") + cmd.Flags().Bool(flagSkipTrackerCheck, false, "set to true to skip tracker check at the end of the tests") return cmd } @@ -94,6 +96,7 @@ func localE2ETest(cmd *cobra.Command, _ []string) { skipSetup = must(cmd.Flags().GetBool(flagSkipSetup)) skipBitcoinSetup = must(cmd.Flags().GetBool(flagSkipBitcoinSetup)) skipHeaderProof = must(cmd.Flags().GetBool(flagSkipHeaderProof)) + skipTrackerCheck = must(cmd.Flags().GetBool(flagSkipTrackerCheck)) testTSSMigration = must(cmd.Flags().GetBool(flagTestTSSMigration)) ) @@ -354,7 +357,9 @@ func localE2ETest(cmd *cobra.Command, _ []string) { runTSSMigrationTest(deployerRunner, logger, verbose, conf) } // Verify that there are no trackers left over after tests complete - deployerRunner.EnsureNoTrackers() + if !skipTrackerCheck { + deployerRunner.EnsureNoTrackers() + } // print and validate report networkReport, err := deployerRunner.GenerateNetworkReport() if err != nil { diff --git a/contrib/localnet/orchestrator/start-zetae2e.sh b/contrib/localnet/orchestrator/start-zetae2e.sh index dda5b12cd7..5fa2f3e443 100644 --- a/contrib/localnet/orchestrator/start-zetae2e.sh +++ b/contrib/localnet/orchestrator/start-zetae2e.sh @@ -99,9 +99,11 @@ if [ "$LOCALNET_MODE" == "upgrade" ]; then # set upgrade height to 225 by default UPGRADE_HEIGHT=${UPGRADE_HEIGHT:=225} + OLD_VERSION=$(get_zetacored_version) + COMMON_ARGS="--skip-header-proof --skip-tracker-check" if [[ ! -f deployed.yml ]]; then - zetae2e local $E2E_ARGS --setup-only --config config.yml --config-out deployed.yml --skip-header-proof + zetae2e local $E2E_ARGS --setup-only --config config.yml --config-out deployed.yml ${COMMON_ARGS} if [ $? -ne 0 ]; then echo "e2e setup failed" exit 1 @@ -115,7 +117,7 @@ if [ "$LOCALNET_MODE" == "upgrade" ]; then echo "running E2E command to setup the networks and populate the state..." # Use light flag to ensure tests can complete before the upgrade height - zetae2e local $E2E_ARGS --skip-setup --config deployed.yml --light --skip-header-proof + zetae2e local $E2E_ARGS --skip-setup --config deployed.yml --light ${COMMON_ARGS} if [ $? -ne 0 ]; then echo "first e2e failed" exit 1 @@ -123,9 +125,6 @@ if [ "$LOCALNET_MODE" == "upgrade" ]; then fi echo "Waiting for upgrade height..." - - OLD_VERSION=$(get_zetacored_version) - CURRENT_HEIGHT=0 WAIT_HEIGHT=$(( UPGRADE_HEIGHT - 1 )) # wait for upgrade height @@ -157,9 +156,9 @@ if [ "$LOCALNET_MODE" == "upgrade" ]; then # When the upgrade height is greater than 100 for upgrade test, the Bitcoin tests have been run once, therefore the Bitcoin wallet is already set up # Use light flag to skip advanced tests if [ "$UPGRADE_HEIGHT" -lt 100 ]; then - zetae2e local $E2E_ARGS --skip-setup --config deployed.yml --light --skip-header-proof + zetae2e local $E2E_ARGS --skip-setup --config deployed.yml --light ${COMMON_ARGS} else - zetae2e local $E2E_ARGS --skip-setup --config deployed.yml --skip-bitcoin-setup --light --skip-header-proof + zetae2e local $E2E_ARGS --skip-setup --config deployed.yml --skip-bitcoin-setup --light ${COMMON_ARGS} fi ZETAE2E_EXIT_CODE=$?