From 0d6396450cc3b96064f94c32f4817ea04ec7fae1 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Wed, 28 Sep 2022 13:41:42 +0100 Subject: [PATCH] Add compatibility tests for v5.0.x #2 (#2396) --- .../release-v5.0.x.json | 12 ---- .../release-v5.0.x/client.json | 10 +++ .../release-v5.0.x/incentivized-transfer.json | 15 ++++ .../release-v5.0.x/transfer.json | 14 ++++ .../e2e-compatibility-workflow-call.yaml | 50 +++++++++++++ .github/workflows/e2e-compatibility.yaml | 72 ++++++++----------- 6 files changed, 119 insertions(+), 54 deletions(-) delete mode 100644 .github/compatibility-test-matrices/release-v5.0.x.json create mode 100644 .github/compatibility-test-matrices/release-v5.0.x/client.json create mode 100644 .github/compatibility-test-matrices/release-v5.0.x/incentivized-transfer.json create mode 100644 .github/compatibility-test-matrices/release-v5.0.x/transfer.json create mode 100644 .github/workflows/e2e-compatibility-workflow-call.yaml diff --git a/.github/compatibility-test-matrices/release-v5.0.x.json b/.github/compatibility-test-matrices/release-v5.0.x.json deleted file mode 100644 index 3730a89478d..00000000000 --- a/.github/compatibility-test-matrices/release-v5.0.x.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "include": [ - { - "chain-binary": "simd", - "chain-a-tag": "release-v5.0.x", - "chain-b-tag": "release-v5.0.x", - "chain-image": "ghcr.io/cosmos/ibc-go-simd", - "entrypoint": "TestTransferTestSuite", - "test": "TestReceiveEnabledParam" - } - ] -} diff --git a/.github/compatibility-test-matrices/release-v5.0.x/client.json b/.github/compatibility-test-matrices/release-v5.0.x/client.json new file mode 100644 index 00000000000..ee237c25cff --- /dev/null +++ b/.github/compatibility-test-matrices/release-v5.0.x/client.json @@ -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"], + "entrypoint": ["TestClientTestSuite"], + "test": [ + "TestClientUpdateProposal_Succeeds" + ], + "chain-binary": ["simd"], + "chain-image": ["ghcr.io/cosmos/ibc-go-simd"] +} diff --git a/.github/compatibility-test-matrices/release-v5.0.x/incentivized-transfer.json b/.github/compatibility-test-matrices/release-v5.0.x/incentivized-transfer.json new file mode 100644 index 00000000000..f179a1683b2 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v5.0.x/incentivized-transfer.json @@ -0,0 +1,15 @@ +{ + "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"] +} diff --git a/.github/compatibility-test-matrices/release-v5.0.x/transfer.json b/.github/compatibility-test-matrices/release-v5.0.x/transfer.json new file mode 100644 index 00000000000..7779f9f29b0 --- /dev/null +++ b/.github/compatibility-test-matrices/release-v5.0.x/transfer.json @@ -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"] +} diff --git a/.github/workflows/e2e-compatibility-workflow-call.yaml b/.github/workflows/e2e-compatibility-workflow-call.yaml new file mode 100644 index 00000000000..9aa82416c69 --- /dev/null +++ b/.github/workflows/e2e-compatibility-workflow-call.yaml @@ -0,0 +1,50 @@ +on: + workflow_call: + 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) }} + 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" diff --git a/.github/workflows/e2e-compatibility.yaml b/.github/workflows/e2e-compatibility.yaml index 482d8d321de..31a6c05319c 100644 --- a/.github/workflows/e2e-compatibility.yaml +++ b/.github/workflows/e2e-compatibility.yaml @@ -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 env: REGISTRY: ghcr.io @@ -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 + with: + docker-tag: "${{ needs.determine-docker-tag.outputs.docker-tag }}" + test-suite: "transfer" - 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"