Skip to content

Commit

Permalink
fix(e2e): skip tracker check in upgrade tests (#2688)
Browse files Browse the repository at this point in the history
* set OLD_VERSION before running e2e to tolerate missed upgrade height

* add skip-tracker-check arg
  • Loading branch information
gartnera authored Aug 13, 2024
1 parent 0e199ae commit 8efbf3c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
7 changes: 6 additions & 1 deletion cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const (
flagTestTSSMigration = "test-tss-migration"
flagSkipBitcoinSetup = "skip-bitcoin-setup"
flagSkipHeaderProof = "skip-header-proof"
flagSkipTrackerCheck = "skip-tracker-check"
)

var (
Expand Down Expand Up @@ -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
}
Expand All @@ -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))
)

Expand Down Expand Up @@ -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 {
Expand Down
13 changes: 6 additions & 7 deletions contrib/localnet/orchestrator/start-zetae2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -115,17 +117,14 @@ 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
fi
fi

echo "Waiting for upgrade height..."

OLD_VERSION=$(get_zetacored_version)

CURRENT_HEIGHT=0
WAIT_HEIGHT=$(( UPGRADE_HEIGHT - 1 ))
# wait for upgrade height
Expand Down Expand Up @@ -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=$?
Expand Down

0 comments on commit 8efbf3c

Please sign in to comment.