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 compatibility tests for v5.0.x #2 #2396

Merged
merged 28 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b5c7185
chore: fixing workflow inputs
chatton Sep 22, 2022
329d8e0
chore: updating release v5.0.x json
chatton Sep 22, 2022
b86a65a
chore: add full set of transfer tests
chatton Sep 22, 2022
536e37d
chore: adding incentivized tests
chatton Sep 22, 2022
d5c758b
chore: adding tests for client update
chatton Sep 22, 2022
2759086
chore: change to 3.2 and 2.4
chatton Sep 22, 2022
f123c50
Merge branch 'main' into cian/add-additional-tests-for-v5
chatton Sep 23, 2022
1a4cc7d
corrected tag
chatton Sep 23, 2022
c6508d9
chore: bump 3.0 to 3.3 and 2.0 to 2.1
chatton Sep 23, 2022
b52332b
Merge branch 'main' into cian/add-additional-tests-for-v5
chatton Sep 23, 2022
0bfbd52
Merge branch 'cian/add-additional-tests-for-v5' into cian/add-additio…
chatton Sep 26, 2022
0880657
chore: change release json into non include format
chatton Sep 26, 2022
a18213a
chore: separate chain a and chain b lists
chatton Sep 26, 2022
65f66e9
chore: adding workflow call for compatibility tests
chatton Sep 26, 2022
8774891
chore: corrected needs array
chatton Sep 26, 2022
f6fba04
chore: fixed workflow call
chatton Sep 26, 2022
0ca1496
chore: refactor directory structure
chatton Sep 26, 2022
c385f3b
chore: added job for client and incentivized transfer
chatton Sep 26, 2022
63f4b05
chore: add determine docker tag to needs array
chatton Sep 26, 2022
3bb23c8
chore: updated versions
chatton Sep 26, 2022
69eeeb8
chore: change from chain-a-tag to chain-a
chatton Sep 26, 2022
ee16871
Merge branch 'main' into cian/add-additional-tests-for-v5-github-matrix
chatton Sep 26, 2022
1dc3c08
chore: specify chain image in matrix
chatton Sep 26, 2022
e01789d
Merge branch 'cian/add-additional-tests-for-v5-github-matrix' of http…
chatton Sep 26, 2022
285a161
Merge branch 'main' into cian/add-additional-tests-for-v5-github-matrix
chatton Sep 27, 2022
95c29f7
Merge branch 'main' into cian/add-additional-tests-for-v5-github-matrix
chatton Sep 27, 2022
6d4289f
Merge branch 'main' into cian/add-additional-tests-for-v5-github-matrix
chatton Sep 28, 2022
cc81215
Merge branch 'main' into cian/add-additional-tests-for-v5-github-matrix
colin-axner Sep 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/compatibility-test-matrices/release-v5.0.x.json

This file was deleted.

10 changes: 10 additions & 0 deletions .github/compatibility-test-matrices/release-v5.0.x/client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"chain-a": ["release-v5.0.x", "v4.1.0", "v3.3.0", "v2.4.0"],
"chain-b": ["release-v5.0.x", "v4.1.0", "v3.3.0", "v2.4.0"],
Comment on lines +2 to +3
Copy link
Contributor

Choose a reason for hiding this comment

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

so clean! ❤️

"entrypoint": ["TestClientTestSuite"],
"test": [
"TestClientUpdateProposal_Succeeds"
],
"chain-binary": ["simd"],
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these values get expanded so the workflow runs with every permutation of these values.

"chain-a": ["release-v5.0.x", "v4.1.0"],
"chain-b": ["release-v5.0.x", "v4.1.0"],
"entrypoint": ["TestIncentivizedTransferTestSuite"],
"test": [
"TestMsgPayPacketFee_AsyncSingleSender_Succeeds",
"TestMsgPayPacketFee_InvalidReceiverAccount",
"TestMultiMsg_MsgPayPacketFeeSingleSender",
"TestMsgPayPacketFee_SingleSender_TimesOut",
"TestPayPacketFeeAsync_SingleSender_NoCounterPartyAddress",
"TestMsgPayPacketFee_AsyncMultipleSenders_Succeeds"
],
"chain-binary": ["simd"],
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"chain-a": ["release-v5.0.x", "v4.1.0", "v3.3.0", "v2.4.0"],
"chain-b": ["release-v5.0.x", "v4.1.0", "v3.3.0", "v2.4.0"],
"entrypoint": ["TestTransferTestSuite"],
"test": [
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
],
"chain-binary": ["simd"],
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
}
50 changes: 50 additions & 0 deletions .github/workflows/e2e-compatibility-workflow-call.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
workflow_call:
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 is a re-usable workflow that we can call for each test suite.

inputs:
docker-tag:
description: 'Docker tag being used'
required: true
type: string
test-suite:
description: 'Test suite to run'
required: true
type: string


jobs:
load-test-matrix:
outputs:
test-matrix: ${{ steps.set-test-matrix.outputs.test-matrix }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
# use jq -c to put the full json contents on a single line. This is required when using the json body
# to create the matrix in the following job.
test_matrix="$(cat .github/compatibility-test-matrices/${{ inputs.docker-tag }}/${{ inputs.test-suite }}.json | jq -c)"
echo $test_matrix
echo "::set-output name=test-matrix::$test_matrix"
id: set-test-matrix
e2e:
runs-on: ubuntu-latest
needs: load-test-matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.load-test-matrix.outputs.test-matrix) }}
Copy link
Member

Choose a reason for hiding this comment

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

Aha, so this magic uses load-test-matrix to parse the JSON files and set the values in matrix which is used below to run the e2e test and populate the env?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes the previous job load-test-matrix stores a json string as its output (the contents of a json file depending on args) and the matrix field accepts dynamic input (or statically defined in the workflow)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is indeed magic 😅

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 process of passing variables between steps is quite cumbersome unfortunately 😓

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Run e2e Test
run: |
cd e2e
make e2e-test entrypoint=${{ matrix.entrypoint }} test=${{ matrix.test }}
env:
# each test has its own set of variables to specify which images are used.
CHAIN_IMAGE: "${{ matrix.chain-image }}"
CHAIN_A_TAG: "${{ matrix.chain-a }}"
CHAIN_B_TAG: "${{ matrix.chain-b }}"
CHAIN_BINARY: "${{ matrix.chain-binary }}"
RLY_TAG: "v2.0.0"
72 changes: 30 additions & 42 deletions .github/workflows/e2e-compatibility.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Compatibility E2E
on:
workflow_dispatch:
release-branch:
description: 'Release branch to test'
required: true
type: choice
options:
- release/v5.0.x
inputs:
release-branch:
description: 'Release branch to test'
required: true
type: choice
options:
- release/v5.0.x
Comment on lines +4 to +10
Copy link
Member

Choose a reason for hiding this comment

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

So do we need to add all release branches we want to test with 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.

yes - this is just for a dropdown, if we prefer, we can have a text box and enter anything we like. I just think the dropdown is better UX

Copy link
Member

Choose a reason for hiding this comment

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

Agree!


env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -47,42 +48,29 @@ jobs:
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${{ needs.determine-docker-tag.outputs.docker-tag }}"
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${{ needs.determine-docker-tag.outputs.docker-tag }}"
load-test-matrix:
outputs:
test-matrix: ${{ steps.set-test-matrix.outputs.test-matrix }}
needs: determine-docker-tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
# use jq -c to put the full json contents on a single line. This is required when using the json body
# to create the matrix in the following job.
test_matrix="$(cat .github/compatibility-test-matrices/${{ needs.determine-docker-tag.outputs.docker-tag }}.json | jq -c)"
echo $test_matrix
echo "::set-output name=test-matrix::$test_matrix"
id: set-test-matrix
transfer:
needs:
- build-release-image
- determine-docker-tag
uses: ./.github/workflows/e2e-compatibility-workflow-call.yaml
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 is how workflows can be re-used in github actions.

with:
docker-tag: "${{ needs.determine-docker-tag.outputs.docker-tag }}"
test-suite: "transfer"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these strings map to sub directories, I'm open to alternatives if there are any suggestions!

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I understand fully here. Could you provide me with the verbose output? 😅

I initially thought you meant they correspond to the directory under e2e/tests/...

Copy link
Member

Choose a reason for hiding this comment

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

Will we also need to add blocks for interchain-accounts here?

Copy link
Contributor Author

@chatton chatton Sep 27, 2022

Choose a reason for hiding this comment

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

maybe we could rename the value to be something more explicit like matrix-filename WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

I'm easy. I think its fine to leave as is

Copy link
Contributor

Choose a reason for hiding this comment

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

Whatever is fine by me!


e2e-tests:
runs-on: ubuntu-latest
client:
needs:
- load-test-matrix
- build-release-image
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.load-test-matrix.outputs.test-matrix) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Run e2e Test
run: |
cd e2e
make e2e-test entrypoint=${{ matrix.entrypoint }} test=${{ matrix.test }}
env:
# each test has its own set of variables to specify which images are used.
CHAIN_IMAGE: "${{ matrix.chain-image }}"
CHAIN_A_TAG: "${{ matrix.chain-a-tag }}"
CHAIN_B_TAG: "${{ matrix.chain-b-tag }}"
CHAIN_BINARY: "${{ matrix.chain-binary }}"
RLY_TAG: "v2.0.0"
- determine-docker-tag
uses: ./.github/workflows/e2e-compatibility-workflow-call.yaml
with:
docker-tag: "${{ needs.determine-docker-tag.outputs.docker-tag }}"
test-suite: "client"

incentivized-transfer:
needs:
- build-release-image
- determine-docker-tag
uses: ./.github/workflows/e2e-compatibility-workflow-call.yaml
with:
docker-tag: "${{ needs.determine-docker-tag.outputs.docker-tag }}"
test-suite: "incentivized-transfer"