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

testutils refactors and cleanup #472

Merged
merged 10 commits into from
Nov 15, 2022
Merged

testutils refactors and cleanup #472

merged 10 commits into from
Nov 15, 2022

Conversation

shaspitz
Copy link
Contributor

@shaspitz shaspitz commented Nov 11, 2022

Corrected version of #467

This PR should not change test behavior in anyway. It should allow the implementation of multiple consumers in e2e tests to be cleaner. Changes included:

  • Misc cleanup of testing documentation
  • Remove the unused testutil/sample folder
  • Clean up what was testutil/simapp/simapp.go and is now testutil/ibc_testing/specific_setup.go testutil/ibc_testing/generic_setup.go with semantics closer to the design of the IBC testing package. I've also made those files more succint, and less boilerplate-y
  • Adjust e2e test instantiation to use the new IBC testing util functions

@shaspitz shaspitz marked this pull request as ready for review November 11, 2022 17:59
@shaspitz shaspitz requested a review from MSalopek November 15, 2022 17:51
Copy link
Contributor

@MSalopek MSalopek left a comment

Choose a reason for hiding this comment

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

LGTM!

A bit confused about the democracy setup, but don't see any issues with the PR

tests/e2e/democracy.go Outdated Show resolved Hide resolved
tests/e2e/instance_test.go Show resolved Hide resolved
tests/e2e/setup.go Outdated Show resolved Hide resolved
func AddDemocracyConsumer[T e2e.DemocConsumerApp](coordinator *ibctesting.Coordinator, t *testing.T,
appIniter ibctesting.AppIniter) (*ibctesting.TestChain, T) {

democConsumer := ibctesting.NewTestChain(t, coordinator, appIniter, democConsumerChainID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is democConsumer setup different from initialization done in AddConsumers?

Provider's valset is copied to each of the instantiated consumers so I'm a bit confused. Isn't democracy chain intended to be used as a CCV consumer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's notable that the democracy consumer e2e tests are separated from the normal e2e tests. The democracy consumer tests do not run with a provider, so they need to be setup slightly differently (no copying of provider val set).

The democracy consumer should be able to pass the normal set of e2e ccv tests tho, it's not currently able to do this. see #397

@danwt danwt merged commit 33137b3 into main Nov 15, 2022
@danwt danwt deleted the testutil-refactor branch November 15, 2022 20:05
danwt pushed a commit that referenced this pull request Nov 16, 2022
commit fb83bb7
Author: MSalopek <[email protected]>
Date:   Tue Nov 15 22:54:06 2022 +0100

    add multiple consumer chains in integration tests (#407)

commit 33137b3
Author: Shawn Marshall-Spitzbart <[email protected]>
Date:   Tue Nov 15 12:05:45 2022 -0800

    testutils refactors and cleanup (#472)

    * changes

    * mas

    * Update README.md

    * Update README.md

    * sorry for the friday night emails

    * Update instance_test.go

    * util naming

commit 0096317
Author: Daniel T <[email protected]>
Date:   Tue Nov 15 19:24:40 2022 +0000

    Adds Cryptographic Identity utility for working with various keys ect (#470)

    * Adds crypto.go Cryptographic Identity util

    * Changes mock to ibcmock

    Co-authored-by: Daniel <[email protected]>

commit b10e132
Author: Shawn Marshall-Spitzbart <[email protected]>
Date:   Mon Nov 14 16:32:31 2022 -0800

    circuit breaker params  (#444)

    * changes

    * Update params.go

commit df53566
Author: Shawn Marshall-Spitzbart <[email protected]>
Date:   Mon Nov 14 16:11:22 2022 -0800

    Slashing related e2e test improvements (#461)
danwt added a commit that referenced this pull request Nov 16, 2022
Squashed commit of the following:

commit fb83bb7
Author: MSalopek <[email protected]>
Date:   Tue Nov 15 22:54:06 2022 +0100

    add multiple consumer chains in integration tests (#407)

commit 33137b3
Author: Shawn Marshall-Spitzbart <[email protected]>
Date:   Tue Nov 15 12:05:45 2022 -0800

    testutils refactors and cleanup (#472)

    * changes

    * mas

    * Update README.md

    * Update README.md

    * sorry for the friday night emails

    * Update instance_test.go

    * util naming

commit 0096317
Author: Daniel T <[email protected]>
Date:   Tue Nov 15 19:24:40 2022 +0000

    Adds Cryptographic Identity utility for working with various keys ect (#470)

    * Adds crypto.go Cryptographic Identity util

    * Changes mock to ibcmock

    Co-authored-by: Daniel <[email protected]>

commit b10e132
Author: Shawn Marshall-Spitzbart <[email protected]>
Date:   Mon Nov 14 16:32:31 2022 -0800

    circuit breaker params  (#444)

    * changes

    * Update params.go

commit df53566
Author: Shawn Marshall-Spitzbart <[email protected]>
Date:   Mon Nov 14 16:11:22 2022 -0800

    Slashing related e2e test improvements (#461)

Co-authored-by: Daniel <[email protected]>
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.

3 participants