Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Stateful upgrade #1135

Merged
merged 50 commits into from
Sep 29, 2023
Merged

test: Stateful upgrade #1135

merged 50 commits into from
Sep 29, 2023

Conversation

kevinssgh
Copy link
Contributor

@kevinssgh kevinssgh commented Sep 14, 2023

Description

Added new target in makefile that will run the smoketest twice and perform a binary update between. The old and new versions to be tested can be passed into the makefile target as environment variables.

  • zetavisor and upgrade binaries are integrated in dockerfile
  • new script added to start network and create gov proposal for zetacore upgrade - zetavisor will do this automatically
  • updated smoketest to optionally start at a particular height

ex.

stateful-upgrade:
@echo "--> Starting stateful smoketest"
$(DOCKER) build --build-arg old_version=v9.0.0 --build-arg new_version=v9.0.6-test -t zetanode -f ./Dockerfile-versioned .
$(DOCKER) build -t orchestrator -f contrib/localnet/orchestrator/Dockerfile.fastbuild .
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose-stateful.yml up -d

Closes: #1117

TODO: Need to create script that restarts zetaclients after upgrade.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

@@ -295,8 +303,9 @@ func LocalSmokeTest(_ *cobra.Command, _ []string) {
smokeTest.TestMessagePassingRevertSuccess()
smokeTest.CheckZRC20ReserveAndSupply()

smokeTest.TestPauseZRC20()
smokeTest.CheckZRC20ReserveAndSupply()
//DISABLED temporarily since older binaries might not work with this due to admin account
Copy link
Contributor

@ws4charlie ws4charlie Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember Bertrant created these two tests and he made them working on develop? No blocking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think TestPauseZRC20 and TestUpdateBytcode can be commented out since it only concerns isolated actions and don't need to be checked everytime in the CI.

But I added in the genesis generation of smoke tests the account for foreign coin admin, I'm not sure what would cause it to not work then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your change is not included in older versions. This particular test path would run the smoketest on an older version, do an upgrade then run the smoketest again. It isn't guaranteed that the account will be present in the older versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should comment smokeTest.TestUpdateBytecode() for the same reason, also use the admin account.

I think we could keep those disabled since it represents tests for administration, we might want to have a specific smoketest for it.

Copy link
Contributor

@ws4charlie ws4charlie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@lumtis
Copy link
Member

lumtis commented Sep 18, 2023

Is it still WIP @kevinssgh ?

@fadeev fadeev marked this pull request as draft September 18, 2023 17:26
@fadeev fadeev changed the title test: WIP: Stateful upgrade test: Stateful upgrade Sep 18, 2023
@kevinssgh kevinssgh marked this pull request as ready for review September 20, 2023 15:26
@kevinssgh kevinssgh merged commit 5bbd1da into develop Sep 29, 2023
17 of 19 checks passed
@lumtis lumtis deleted the stateful-upgrade branch October 27, 2023 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stateful upgrade test
4 participants