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

Update Compatibility tests to run against all unreleased versions #2680

Merged
merged 22 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
97191b2
chore: adding wip workflow
chatton Nov 3, 2022
14897a0
chore: fixing workflow syntax
chatton Nov 3, 2022
248f958
chore: removing non existant dependency
chatton Nov 3, 2022
1958564
chore: adding matricies for all release branches
chatton Nov 3, 2022
6f1265a
chore: adding workflow dispatch as option
chatton Nov 3, 2022
390bff6
chore: renaming directory to unreleased
chatton Nov 3, 2022
b6e15cb
chore: add unreleased as special case in existing workflow
chatton Nov 4, 2022
8aa7cc8
chore: replace double with single quotes
chatton Nov 4, 2022
c8d5543
chore: checkout release branch correctly from matrix
chatton Nov 4, 2022
87ba516
chore: adding docstring for workflow
chatton Nov 4, 2022
0a62ea3
chore: renaming docker tag to test directory
chatton Nov 4, 2022
0278828
chore: correcting name of output variable
chatton Nov 4, 2022
4b8de9e
Merge branch 'main' into cian/add-compatibilty-tests-for-release-tips
chatton Nov 4, 2022
ff70fcb
chore: removing v5.0.x from transfer matrix
chatton Nov 4, 2022
5af8aca
Merge branch 'main' into cian/add-compatibilty-tests-for-release-tips
Nov 8, 2022
acec956
Merge branch 'main' into cian/add-compatibilty-tests-for-release-tips
chatton Nov 8, 2022
083c379
Merge branch 'main' into cian/add-compatibilty-tests-for-release-tips
chatton Nov 8, 2022
f483813
Merge branch 'main' into cian/add-compatibilty-tests-for-release-tips
Nov 10, 2022
a6924d5
Merge branch 'main' into cian/add-compatibilty-tests-for-release-tips
chatton Nov 11, 2022
2bc26a3
Merge branch 'main' into cian/add-compatibilty-tests-for-release-tips
chatton Nov 14, 2022
967916e
Merge branch 'main' into cian/add-compatibilty-tests-for-release-tips
chatton Nov 15, 2022
306a7d9
Merge branch 'main' into cian/add-compatibilty-tests-for-release-tips
chatton Nov 15, 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
10 changes: 10 additions & 0 deletions .github/compatibility-test-matrices/unreleased/client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"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"],
"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"],
"entrypoint": ["TestClientTestSuite"],
"test": [
"TestClientUpdateProposal_Succeeds"
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this test will work for all these combinations...

],
"chain-binary": ["simd"],
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
}
10 changes: 10 additions & 0 deletions .github/compatibility-test-matrices/unreleased/connection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"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"],
"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"],
"entrypoint": ["TestConnectionTestSuite"],
"test": [
"TestMaxExpectedTimePerBlockParam"
],
"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 @@
{
"chain-a": ["release-v6.0.x", "release-v5.1.x", "release-v5.0.x", "release-v4.2.x"],
"chain-b": ["release-v6.0.x", "release-v5.1.x", "release-v5.0.x", "release-v4.2.x"],
Copy link
Contributor

Choose a reason for hiding this comment

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

i guess pending the updates on the SDK we will have to update the 5.1 and 5.0 lines to be 5.2 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we can actually get this merged and then bump the versions once we have the new lines.

"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"]
}
15 changes: 15 additions & 0 deletions .github/compatibility-test-matrices/unreleased/transfer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"chain-a": ["release-v6.0.x", "release-v5.1.x", "release-v4.2.x", "release-v3.4.x", "release-v2.5.x"],
"chain-b": ["release-v6.0.x", "release-v5.1.x", "release-v4.2.x", "release-v3.4.x", "release-v2.5.x"],
"entrypoint": ["TestTransferTestSuite"],
"test": [
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
],
"chain-binary": ["simd"],
"chain-image": ["ghcr.io/cosmos/ibc-go-simd"]
}
6 changes: 3 additions & 3 deletions .github/workflows/e2e-compatibility-workflow-call.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
on:
workflow_call:
inputs:
docker-tag:
description: 'Docker tag being used'
test-file-directory:
description: 'Directory containing compatibility matrices'
required: true
type: string
test-suite:
Expand All @@ -21,7 +21,7 @@ jobs:
- 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)"
test_matrix="$(cat .github/compatibility-test-matrices/${{ inputs.test-file-directory }}/${{ inputs.test-suite }}.json | jq -c)"
echo $test_matrix
echo "::set-output name=test-matrix::$test_matrix"
id: set-test-matrix
Expand Down
60 changes: 39 additions & 21 deletions .github/workflows/e2e-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
workflow_dispatch:
inputs:
release-branch:
description: 'Release branch to test'
description: 'Release branch to test (unreleased to run all release branches against each other)'
required: true
type: choice
options:
Expand All @@ -13,6 +13,7 @@ on:
- release/v5.0.x
- release/v5.1.x
- release/v6.0.x
- unreleased

env:
REGISTRY: ghcr.io
Expand All @@ -21,65 +22,82 @@ env:
RELEASE_BRANCH: '${{ inputs.release-branch }}'

jobs:
determine-docker-tag:
determine-test-directory:
runs-on: ubuntu-latest
outputs:
docker-tag: ${{ steps.set-docker-tag.outputs.docker-tag }}
test-directory: ${{ steps.set-test-dir.outputs.test-directory }}
steps:
- run: |
docker_tag="$(echo $RELEASE_BRANCH | sed 's/\//-/')"
echo $docker_tag
echo "::set-output name=docker-tag::$docker_tag"
id: set-docker-tag
test_dir="$(echo $RELEASE_BRANCH | sed 's/\//-/')"
echo $test_dir
echo "::set-output name=test-directory::$test_dir"
id: set-test-dir

build-release-image:
# build-release-images builds all docker images that are relevant for the compatibility tests. If a single release
# branch is specified, only that image will be built, e.g. release-v6.0.x but if 'unreleased' is specified
# every image will be built.
build-release-images:
runs-on: ubuntu-latest
needs: determine-docker-tag
strategy:
matrix:
release-branch:
- release/v2.5.x
- release/v3.4.x
- release/v4.2.x
- release/v5.0.x
- release/v5.1.x
- release/v6.0.x
steps:
- uses: actions/checkout@v3
if: env.RELEASE_BRANCH == 'unreleased' || env.RELEASE_BRANCH == matrix.release-branch
with:
ref: "${{ env.RELEASE_BRANCH }}"
ref: "${{ matrix.release-branch }}"
fetch-depth: 0
- name: Log in to the Container registry
if: env.RELEASE_BRANCH == 'unreleased' || env.RELEASE_BRANCH == matrix.release-branch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unfortunately there's not really an elegant way to fully skip one iteration of the matrix, we instead need to skip each step using some condition. (or at least I don't know of one!)

uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch Makefile dependencies
if: env.RELEASE_BRANCH == 'unreleased' || env.RELEASE_BRANCH == matrix.release-branch
run: |
mkdir -p contrib/devtools
curl https://raw.githubusercontent.com/cosmos/ibc-go/main/contrib/devtools/Makefile -o contrib/devtools/Makefile
- name: Fetch latest Dockerfile
if: env.RELEASE_BRANCH == 'unreleased' || env.RELEASE_BRANCH == matrix.release-branch
run: curl https://raw.githubusercontent.com/cosmos/ibc-go/main/Dockerfile -o Dockerfile
- name: Build image
if: env.RELEASE_BRANCH == 'unreleased' || env.RELEASE_BRANCH == matrix.release-branch
run: |
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 }}"
docker_tag="$(echo ${{ matrix.release-branch }} | sed 's/\//-/')"
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:$docker_tag"
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:$docker_tag"

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

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

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