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

feat(test): adding support for backwards compatibility testing #1912

Merged
merged 27 commits into from
Aug 11, 2022

Conversation

chatton
Copy link
Contributor

@chatton chatton commented Aug 8, 2022

Description

This PR adds support for backwards compatibility testing in the form of allowing us to specify the images to be used for chain A and chain B by running a workflow_dispatch workflow via the Github UI or a tool like gh

E.g. we can run FeeMiddlewareTestSuite with chain A on main and chain B on v4.0.0-r2

We will have UI access to this workflow once it is merged to main, in order to test it, the best option is to use gh. You can test it with this command once you have gh installed.

gh workflow run "Manual E2E" --ref "cian/issue#1911-support-backwards-compatibility-tests" -f test-entry-point=TestFeeMiddlewareTestSuite -f chain-b-image="ghcr.io/cosmos/ibc-go-simd" -f chain-b-tag="v4.0.0-rc3" -f chain-a-image="ghcr.io/cosmos/ibc-go-simd-e2e" -f chain-a-tag="main" -f relayer-tag="v2.0.0-rc2"

Changing values as appropriate.

closes: #1911


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.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

e2e/go.mod Outdated
)

replace github.com/strangelove-ventures/ibctest => ../../forks/ibctest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this must be removed before the PR can be merged.

@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2022

Codecov Report

Merging #1912 (c4bca40) into main (f054208) will decrease coverage by 0.03%.
The diff coverage is 36.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1912      +/-   ##
==========================================
- Coverage   80.12%   80.09%   -0.04%     
==========================================
  Files         167      167              
  Lines       11766    11773       +7     
==========================================
+ Hits         9428     9429       +1     
- Misses       1923     1929       +6     
  Partials      415      415              
Impacted Files Coverage Δ
cmd/build_test_matrix/main.go 65.82% <36.36%> (-5.02%) ⬇️

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.

wahoo!!

rlyTag, ok := os.LookupEnv(GoRelayerTag)
chainBSimdTag, ok := os.LookupEnv(ChainBSimdTagEnv)
if !ok {
chainBSimdTag = chainASimdTag
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 document the default behaviour somewhere? That is when the chainB image/tag isn't specified. It might be a little odd if the image is specified but that tag isn't? or vice versa?

// getGithubActionMatrixForTests returns a json string representing the contents that should go in the matrix
// field in a github action workflow. This string can be used with `fromJSON(str)` to dynamically build
// the workflow matrix to include all E2E tests under the e2eRootDirectory directory.
func getGithubActionMatrixForTests(e2eRootDirectory string) (GithubActionTestMatrix, error) {
func getGithubActionMatrixForTests(e2eRootDirectory, suite string) (GithubActionTestMatrix, error) {
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 add godoc to specify the usage of an empty string to indicate runAllTests?

Comment on lines 1 to 34
name: Manual E2E
on:
workflow_dispatch:
inputs:
test-suite:
description: 'The Test Suite To Run'
required: true
type: string
default: ""
chain-a-image:
description: 'The image to use for chain A'
required: true
type: string
default: "ghcr.io/cosmos/ibc-go-simd-e2e"
chain-a-tag:
description: 'The tag to use for chain A'
required: true
type: string
default: "main"
chain-b-image:
description: 'The image to use for chain B'
required: true
type: string
default: "ghcr.io/cosmos/ibc-go-simd"
chain-b-tag:
description: 'The tag to use for chain B'
required: true
default: "v4.0.0-rc2"
type: string
relayer-tag:
description: 'The tag to use for the relayer'
required: true
default: "v2.0.0-rc2"
type: string
Copy link
Contributor

Choose a reason for hiding this comment

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

nice! Is the idea to add multiple files, one for each previous version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the way inputs work is that you can specify a value when you run the workflow (vi UI or using a cli tool like gh). This one workflow should let us run any test suite using any combination of versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. So we would run this workflow manually rather than it being run on each pr. That makes sense. Mostly to save execution time?

Copy link
Contributor Author

@chatton chatton Aug 10, 2022

Choose a reason for hiding this comment

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

yes this is a manual task, we can run the permutations we care about when we are doing QA. I think it might be overkill to run all these permutations on every PR.

We can also pick and choose which test suites are important for which versions, I.e. no fee middleware on v2

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. Could you add instructions on how to run manually? I'd like to test it out myself

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@colin-axner I added instructions on how to execute these tests with gh. Once they are merged into main, we will be able to use the UI to trigger the workflows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chatton chatton marked this pull request as ready for review August 10, 2022 11:12
@chatton chatton marked this pull request as draft August 10, 2022 11:22
@chatton chatton marked this pull request as ready for review August 10, 2022 12:31
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.

LGTM! This is so cool! I am very excited :)

type: choice
options:
- v4.0.0-rc3
- v3.0.0-rc2
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- v3.0.0-rc2
- v3.0.0

Copy link
Contributor

Choose a reason for hiding this comment

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

How do we get v3.1, v2.3 etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to start with I just added a few basic entries. This are just images that exist already. All this list is doing is giving us a drop down menu. We can edit it as we see fit! We just need to make sure the images exist.

Copy link
Contributor

@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.

Awesome job

Comment on lines +24 to +30
options:
- main
- v4.0.0-rc3
- v3.0.0
- v2.2.0
- v2.1.0
- v2.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we missing v3.1.0 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are, but that image hasn't actually been built yet. That will have to come in a follow up!

@chatton chatton merged commit 2bd397b into main Aug 11, 2022
@chatton chatton deleted the cian/issue#1911-support-backwards-compatibility-tests branch August 11, 2022 08:05
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.

Support backwards compatibility tests
4 participants