Skip to content

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

Merged
chatton merged 27 commits into
mainfrom
cian/issue#1911-support-backwards-compatibility-tests
Aug 11, 2022
Merged

feat(test): adding support for backwards compatibility testing#1912
chatton merged 27 commits into
mainfrom
cian/issue#1911-support-backwards-compatibility-tests

Conversation

@chatton
Copy link
Copy Markdown
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

Comment thread e2e/go.mod Outdated
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/strangelove-ventures/ibctest => ../../forks/ibctest
Copy link
Copy Markdown
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
Copy Markdown

codecov-commenter commented Aug 9, 2022

Codecov Report

❌ Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.09%. Comparing base (f054208) to head (c4bca40).
⚠️ Report is 2306 commits behind head on main.

Files with missing lines Patch % Lines
cmd/build_test_matrix/main.go 36.36% 7 Missing ⚠️
Additional details and impacted files

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              
Files with missing lines Coverage Δ
cmd/build_test_matrix/main.go 65.82% <36.36%> (-5.02%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
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
Copy Markdown
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?

// 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 :)

Comment thread .github/workflows/e2e-manual.yaml Outdated
type: choice
options:
- v4.0.0-rc3
- v3.0.0-rc2
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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