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

Add v7 to v8 e2e upgrade test #4591

Merged
merged 31 commits into from
Sep 14, 2023

Conversation

chatton
Copy link
Contributor

@chatton chatton commented Sep 6, 2023

Description

ref: #4216

This PR made also makes a few small adjustments/improvements to the upgrade tests.

  1. Upgrade tests now run when the upgrade test file is modified (e.g. in this PR)
  2. Remove need to manually specify a gov proposal ID.
  3. Makes genesis modification backwards compatibile.

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@@ -137,10 +137,13 @@ If this is a compatibility test, ensure that the fields are being sanitized in t

// ExecuteGovProposalV1 submits a governance proposal using the provided user and message and uses all validators
// to vote yes on the proposal. It ensures the proposal successfully passes.
func (s *E2ETestSuite) ExecuteGovProposalV1(ctx context.Context, msg sdk.Msg, chain *cosmos.CosmosChain, user ibc.Wallet, proposalID uint64) {
func (s *E2ETestSuite) ExecuteGovProposalV1(ctx context.Context, msg sdk.Msg, chain *cosmos.CosmosChain, user ibc.Wallet) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

small unrelated improvement to not need to manually track proposal count.

@chatton chatton marked this pull request as ready for review September 11, 2023 10:56
@chatton chatton marked this pull request as draft September 11, 2023 10:56
Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Looks excellent so far! Will wait for bank metadata before dropping the green check 👍

e2e/testsuite/codec.go Show resolved Hide resolved
e2e/tests/upgrades/upgrade_test.go Show resolved Hide resolved
@chatton chatton marked this pull request as ready for review September 13, 2023 09:33
github.com/cometbft/cometbft v0.38.0-rc3
github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef
github.com/cometbft/cometbft v0.38.0
github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230913040121-1c9c5ae64ea8
Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to a newer commit which includes the migration fix.

@chatton chatton mentioned this pull request Sep 13, 2023
3 tasks
@chatton
Copy link
Contributor Author

chatton commented Sep 13, 2023

TestV6ToV7ChainUpgrade seems to be failing for an unknown reason, I'll create a follow up issue to investigate.

@colin-axner colin-axner added the v8 label Sep 13, 2023
Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Thank you @chatton!!! Leaving my approval. Happy to comment out the v6 -> v7 test if we want to tackle in a followup?

Comment on lines 144 to 145
proposalID := s.proposalIds[chain.Config().ChainID]
s.proposalIds[chain.Config().ChainID]++
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we increment after the tx succeeds? It will be incremented even if submission fails, but then I guess the test should fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, yes makes sense to do increment afterwards. In practice I think it will make no difference as the test will fail, but this would be a nice improvement!

Copy link
Member

Choose a reason for hiding this comment

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

defer func() ?

I reckon its probably fine either as you say, test will likely be failing

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

I thought I had already approved when it was draft!

Follow up review looks great! Excellent work @chatton, thank you! 🚀

@@ -34,6 +34,8 @@ const (
type E2ETestSuite struct {
testifysuite.Suite

// proposalIds keeps track of the active proposal ID for each chain.
proposalIds map[string]uint64
Copy link
Member

Choose a reason for hiding this comment

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

maybe the linter cries that this is not proposalIDs ? maybe I cry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh I think you're right 😄

Comment on lines 144 to 145
proposalID := s.proposalIds[chain.Config().ChainID]
s.proposalIds[chain.Config().ChainID]++
Copy link
Member

Choose a reason for hiding this comment

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

defer func() ?

I reckon its probably fine either as you say, test will likely be failing

@chatton chatton requested a review from srdtrk as a code owner September 14, 2023 08:33
@chatton chatton merged commit e49f741 into main Sep 14, 2023
78 of 79 checks passed
@chatton chatton deleted the cian/issue#4216-add-v7-to-v8-e2e-upgrade-test branch September 14, 2023 09:48
@chatton
Copy link
Contributor Author

chatton commented Sep 14, 2023

merged with v7 still failing, this will be fixed in a followup

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.

4 participants