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 upgrade integration-tests checking gov proposal migration v45->v47 #655

Merged
merged 8 commits into from
Sep 25, 2023

Conversation

ysv
Copy link
Contributor

@ysv ysv commented Sep 15, 2023

Description

This PR adds upgrade integration-test where we:

  1. create gov proposal on deposit status
  2. run upgrade of chain
  3. deposit funds to previously create proposal
  4. vote for the proposal
  5. check final proposal status

Reviewers checklist:

  • Try to write more meaningful comments with clear actions to be taken.
  • Nit-picking should be unblocking. Focus on core issues.

Authors checklist

  • Provide a concise and meaningful description
  • Review the code yourself first, before making the PR.
  • Annotate your PR in places that require explanation.
  • Think and try to split the PR to smaller PR if it is big.

This change is Reviewable

@ysv ysv requested a review from a team as a code owner September 15, 2023 11:47
@ysv ysv requested review from dzmitryhil, miladz68 and wojtek-coreum and removed request for a team September 15, 2023 11:47
@ysv ysv marked this pull request as draft September 15, 2023 11:47
@ysv ysv changed the title Add upgrade integration-tests checking gov module migration v45->v47 WIP: Add upgrade integration-tests checking gov module migration v45->v47 Sep 15, 2023
Copy link
Contributor Author

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, and @wojtek-coreum)


integration-tests/upgrade/gov_migration_test.go line 96 at r1 (raw file):

	requireT.NoError(err)
	requireT.Equal(govtypesv1.StatusDepositPeriod, proposal.Status)
	requireT.Equal("", proposal.Proposer) // question here

even though we pass proposer when creating proposal after migration it is not present

This was discussed originally here https://reviewable.io/reviews/CoreumFoundation/coreum/625#-NcgDTM81q-QOMHh9chY

But I'm not sure if we should add step to set proposer inside upgrade since this proposal fails anyway


integration-tests/upgrade/gov_migration_test.go line 123 at r1 (raw file):

	proposalStatus, err := chain.Governance.WaitForVotingToFinalize(ctx, gmt.onDepositProposalId)
	requireT.NoError(err)
	requireT.Equal(govtypesv1.StatusFailed, proposalStatus)

So here it wasn't actually what I expected

As @dzmitryhil predicted, there is no handler for old proposal type and it failed.

Logs from cored:

11:31AM INF proposal tallied module=x/gov proposal=1 results="passed, but msg 0 (/cosmos.gov.v1.MsgExecLegacyContent) failed on execution: distribution: no handler exists for proposal type"

@ysv ysv marked this pull request as ready for review September 18, 2023 08:40
@ysv ysv changed the title WIP: Add upgrade integration-tests checking gov module migration v45->v47 Add upgrade integration-tests checking gov proposal migration v45->v47 Sep 18, 2023
Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @miladz68 and @wojtek-coreum)


integration-tests/upgrade/gov_migration_test.go line 123 at r1 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

So here it wasn't actually what I expected

As @dzmitryhil predicted, there is no handler for old proposal type and it failed.

Logs from cored:

11:31AM INF proposal tallied module=x/gov proposal=1 results="passed, but msg 0 (/cosmos.gov.v1.MsgExecLegacyContent) failed on execution: distribution: no handler exists for proposal type"

The chain is still running. And the test looks not 100% stable, right?

Copy link
Contributor Author

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @miladz68 and @wojtek-coreum)


integration-tests/upgrade/gov_migration_test.go line 123 at r1 (raw file):
chain is running after this test and everything works

And the test looks not 100% stable, right?
It is stable

Copy link
Collaborator

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 3 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @miladz68 and @ysv)


integration-tests/upgrade/gov_migration_test.go line 127 at r2 (raw file):

	requireT.Equal(govtypesv1.StatusFailed, proposalStatus)
	// Logs produced inside cored for such a proposal:
	// "proposal tallied module=x/gov proposal=1 results="passed, but msg 0 (/cosmos.gov.v1.MsgExecLegacyContent) failed on execution: distribution: no handler exists for proposal type"

It should be fixed, right?

Copy link
Contributor

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @miladz68 and @ysv)


integration-tests/upgrade/gov_migration_test.go line 123 at r1 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

chain is running after this test and everything works

And the test looks not 100% stable, right?
It is stable

It it's stable let's keep it.

@ysv ysv requested a review from wojtek-coreum September 20, 2023 10:36
Copy link
Contributor Author

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @miladz68 and @wojtek-coreum)


integration-tests/upgrade/gov_migration_test.go line 127 at r2 (raw file):

Previously, wojtek-coreum (Wojtek) wrote…

It should be fixed, right?

No this is expected and we agreed to keep it
I just put the error which is produced during this proposal execution to have better explanation of what happens

Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 3 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @wojtek-coreum and @ysv)


integration-tests/upgrade/gov_migration_test.go line 127 at r2 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

No this is expected and we agreed to keep it
I just put the error which is produced during this proposal execution to have better explanation of what happens

change is not needed.

@ysv ysv requested review from wojtek-coreum and removed request for wojtek-coreum September 21, 2023 15:34
@ysv ysv dismissed wojtek-coreum’s stale review September 22, 2023 13:47

discussed as team

@ysv ysv merged commit fb8b046 into master Sep 25, 2023
@ysv ysv deleted the yaroslav/upgrade-gov-migration-test branch September 25, 2023 08:41
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