Skip to content

Commit 65b3ddf

Browse files
authored
e2e: updated compatibility tests to support running against all unreleased versions (#2680)
1 parent fb9dedd commit 65b3ddf

File tree

6 files changed

+92
-24
lines changed

6 files changed

+92
-24
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"chain-a": ["release-v6.0.x", "release-v5.1.x", "release-v5.0.x", "release-v4.2.x", "release-v3.4.x", "release-v2.5.x"],
3+
"chain-b": ["release-v6.0.x", "release-v5.1.x", "release-v5.0.x", "release-v4.2.x", "release-v3.4.x", "release-v2.5.x"],
4+
"entrypoint": ["TestClientTestSuite"],
5+
"test": [
6+
"TestClientUpdateProposal_Succeeds"
7+
],
8+
"chain-binary": ["simd"],
9+
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"chain-a": ["release-v6.0.x", "release-v5.1.x", "release-v5.0.x", "release-v4.2.x", "release-v3.4.x", "release-v2.5.x"],
3+
"chain-b": ["release-v6.0.x", "release-v5.1.x", "release-v5.0.x", "release-v4.2.x", "release-v3.4.x", "release-v2.5.x"],
4+
"entrypoint": ["TestConnectionTestSuite"],
5+
"test": [
6+
"TestMaxExpectedTimePerBlockParam"
7+
],
8+
"chain-binary": ["simd"],
9+
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
10+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"chain-a": ["release-v6.0.x", "release-v5.1.x", "release-v5.0.x", "release-v4.2.x"],
3+
"chain-b": ["release-v6.0.x", "release-v5.1.x", "release-v5.0.x", "release-v4.2.x"],
4+
"entrypoint": ["TestIncentivizedTransferTestSuite"],
5+
"test": [
6+
"TestMsgPayPacketFee_AsyncSingleSender_Succeeds",
7+
"TestMsgPayPacketFee_InvalidReceiverAccount",
8+
"TestMultiMsg_MsgPayPacketFeeSingleSender",
9+
"TestMsgPayPacketFee_SingleSender_TimesOut",
10+
"TestPayPacketFeeAsync_SingleSender_NoCounterPartyAddress",
11+
"TestMsgPayPacketFee_AsyncMultipleSenders_Succeeds"
12+
],
13+
"chain-binary": ["simd"],
14+
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"chain-a": ["release-v6.0.x", "release-v5.1.x", "release-v4.2.x", "release-v3.4.x", "release-v2.5.x"],
3+
"chain-b": ["release-v6.0.x", "release-v5.1.x", "release-v4.2.x", "release-v3.4.x", "release-v2.5.x"],
4+
"entrypoint": ["TestTransferTestSuite"],
5+
"test": [
6+
"TestMsgTransfer_Succeeds_Nonincentivized",
7+
"TestMsgTransfer_Fails_InvalidAddress",
8+
"TestMsgTransfer_Timeout_Nonincentivized",
9+
"TestMsgTransfer_WithMemo",
10+
"TestSendEnabledParam",
11+
"TestReceiveEnabledParam"
12+
],
13+
"chain-binary": ["simd"],
14+
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
15+
}

.github/workflows/e2e-compatibility-workflow-call.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
on:
22
workflow_call:
33
inputs:
4-
docker-tag:
5-
description: 'Docker tag being used'
4+
test-file-directory:
5+
description: 'Directory containing compatibility matrices'
66
required: true
77
type: string
88
test-suite:
@@ -21,7 +21,7 @@ jobs:
2121
- run: |
2222
# use jq -c to put the full json contents on a single line. This is required when using the json body
2323
# to create the matrix in the following job.
24-
test_matrix="$(cat .github/compatibility-test-matrices/${{ inputs.docker-tag }}/${{ inputs.test-suite }}.json | jq -c)"
24+
test_matrix="$(cat .github/compatibility-test-matrices/${{ inputs.test-file-directory }}/${{ inputs.test-suite }}.json | jq -c)"
2525
echo $test_matrix
2626
echo "::set-output name=test-matrix::$test_matrix"
2727
id: set-test-matrix

.github/workflows/e2e-compatibility.yaml

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch:
44
inputs:
55
release-branch:
6-
description: 'Release branch to test'
6+
description: 'Release branch to test (unreleased to run all release branches against each other)'
77
required: true
88
type: choice
99
options:
@@ -13,6 +13,7 @@ on:
1313
- release/v5.0.x
1414
- release/v5.1.x
1515
- release/v6.0.x
16+
- unreleased
1617

1718
env:
1819
REGISTRY: ghcr.io
@@ -21,49 +22,66 @@ env:
2122
RELEASE_BRANCH: '${{ inputs.release-branch }}'
2223

2324
jobs:
24-
determine-docker-tag:
25+
determine-test-directory:
2526
runs-on: ubuntu-latest
2627
outputs:
27-
docker-tag: ${{ steps.set-docker-tag.outputs.docker-tag }}
28+
test-directory: ${{ steps.set-test-dir.outputs.test-directory }}
2829
steps:
2930
- run: |
30-
docker_tag="$(echo $RELEASE_BRANCH | sed 's/\//-/')"
31-
echo $docker_tag
32-
echo "::set-output name=docker-tag::$docker_tag"
33-
id: set-docker-tag
31+
test_dir="$(echo $RELEASE_BRANCH | sed 's/\//-/')"
32+
echo $test_dir
33+
echo "::set-output name=test-directory::$test_dir"
34+
id: set-test-dir
3435
35-
build-release-image:
36+
# build-release-images builds all docker images that are relevant for the compatibility tests. If a single release
37+
# branch is specified, only that image will be built, e.g. release-v6.0.x but if 'unreleased' is specified
38+
# every image will be built.
39+
build-release-images:
3640
runs-on: ubuntu-latest
37-
needs: determine-docker-tag
41+
strategy:
42+
matrix:
43+
release-branch:
44+
- release/v2.5.x
45+
- release/v3.4.x
46+
- release/v4.2.x
47+
- release/v5.0.x
48+
- release/v5.1.x
49+
- release/v6.0.x
3850
steps:
3951
- uses: actions/checkout@v3
52+
if: env.RELEASE_BRANCH == 'unreleased' || env.RELEASE_BRANCH == matrix.release-branch
4053
with:
41-
ref: "${{ env.RELEASE_BRANCH }}"
54+
ref: "${{ matrix.release-branch }}"
4255
fetch-depth: 0
4356
- name: Log in to the Container registry
57+
if: env.RELEASE_BRANCH == 'unreleased' || env.RELEASE_BRANCH == matrix.release-branch
4458
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
4559
with:
4660
registry: ${{ env.REGISTRY }}
4761
username: ${{ github.actor }}
4862
password: ${{ secrets.GITHUB_TOKEN }}
4963
- name: Fetch Makefile dependencies
64+
if: env.RELEASE_BRANCH == 'unreleased' || env.RELEASE_BRANCH == matrix.release-branch
5065
run: |
5166
mkdir -p contrib/devtools
5267
curl https://raw.githubusercontent.com/cosmos/ibc-go/main/contrib/devtools/Makefile -o contrib/devtools/Makefile
5368
- name: Fetch latest Dockerfile
69+
if: env.RELEASE_BRANCH == 'unreleased' || env.RELEASE_BRANCH == matrix.release-branch
5470
run: curl https://raw.githubusercontent.com/cosmos/ibc-go/main/Dockerfile -o Dockerfile
5571
- name: Build image
72+
if: env.RELEASE_BRANCH == 'unreleased' || env.RELEASE_BRANCH == matrix.release-branch
5673
run: |
57-
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${{ needs.determine-docker-tag.outputs.docker-tag }}"
58-
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${{ needs.determine-docker-tag.outputs.docker-tag }}"
74+
docker_tag="$(echo ${{ matrix.release-branch }} | sed 's/\//-/')"
75+
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:$docker_tag"
76+
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:$docker_tag"
5977
6078
transfer:
6179
needs:
62-
- build-release-image
63-
- determine-docker-tag
80+
- build-release-images
81+
- determine-test-directory
6482
uses: ./.github/workflows/e2e-compatibility-workflow-call.yaml
6583
with:
66-
docker-tag: "${{ needs.determine-docker-tag.outputs.docker-tag }}"
84+
test-file-directory: "${{ needs.determine-test-directory.outputs.test-directory }}"
6785
test-suite: "transfer"
6886

6987
transfer-params:
@@ -86,18 +104,18 @@ jobs:
86104

87105
client:
88106
needs:
89-
- build-release-image
90-
- determine-docker-tag
107+
- build-release-images
108+
- determine-test-directory
91109
uses: ./.github/workflows/e2e-compatibility-workflow-call.yaml
92110
with:
93-
docker-tag: "${{ needs.determine-docker-tag.outputs.docker-tag }}"
111+
test-file-directory: "${{ needs.determine-test-directory.outputs.test-directory }}"
94112
test-suite: "client"
95113

96114
incentivized-transfer:
97115
needs:
98-
- build-release-image
99-
- determine-docker-tag
116+
- build-release-images
117+
- determine-test-directory
100118
uses: ./.github/workflows/e2e-compatibility-workflow-call.yaml
101119
with:
102-
docker-tag: "${{ needs.determine-docker-tag.outputs.docker-tag }}"
120+
test-file-directory: "${{ needs.determine-test-directory.outputs.test-directory }}"
103121
test-suite: "incentivized-transfer"

0 commit comments

Comments
 (0)