From 7704ff62d8dda7b99e254a88c596d48048c4e8d4 Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:25:57 -0600 Subject: [PATCH 1/9] Split scenarios test --- .github/workflows/interchaintest.yml | 111 +++++++++++++++++++++++++-- Makefile | 20 ++++- 2 files changed, 124 insertions(+), 7 deletions(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index f7f9c4d6a..3e88e3dec 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -133,7 +133,7 @@ jobs: - name: interchaintest run: make interchaintest-fee-grant - scenarios: + scenarios-client: runs-on: ubuntu-latest steps: - name: Set up Go 1.21 @@ -152,8 +152,109 @@ jobs: ${{ runner.os }}-go- - name: interchaintest - run: make interchaintest-scenario + run: make interchaintest-scenario-client + + scenarios-ica: + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.21 + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: checkout relayer + uses: actions/checkout@v2 + + - uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: interchaintest + run: make interchaintest-scenario-ica + + scenarios-interchainaccounts: + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.21 + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: checkout relayer + uses: actions/checkout@v2 + + - uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- - - name: Prune Docker images - if: always() #ensure dangling images are pruned after interchain-test scenario passes or fails - run: docker image prune -f + - name: interchaintest + run: make interchaintest-scenario-interchainaccounts + + scenarios-pathfilter: + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.21 + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: checkout relayer + uses: actions/checkout@v2 + + - uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: interchaintest + run: make interchaintest-scenario-pathfilter + + scenarios-tendermint: + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.21 + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: checkout relayer + uses: actions/checkout@v2 + + - uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: interchaintest + run: make interchaintest-scenario-tendermint + + scenarios-stride: + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.21 + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: checkout relayer + uses: actions/checkout@v2 + + - uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: interchaintest + run: make interchaintest-scenario-stride diff --git a/Makefile b/Makefile index 20e9bbb2b..074a64326 100644 --- a/Makefile +++ b/Makefile @@ -91,8 +91,24 @@ interchaintest-fee-middleware: interchaintest-fee-grant: cd interchaintest && go test -race -v -run TestRelayerFeeGrant . -interchaintest-scenario: ## Scenario tests are suitable for simple networks of 1 validator and no full nodes. They test specific functionality. - cd interchaintest && go test -timeout 30m -race -v -run TestScenario ./... +## Scenario tests are suitable for simple networks of 1 validator and no full nodes. They test specific functionality. +interchaintest-scenario-client: + cd interchaintest && go test -timeout 30m -race -v -run TestScenarioClient ./... + +interchaintest-scenario-ica: + cd interchaintest && go test -timeout 30m -race -v -run TestScenarioICA ./... + +interchaintest-scenario-interchainaccounts: + cd interchaintest && go test -timeout 30m -race -v -run TestScenarioInterchainAccounts ./... + +interchaintest-scenario-pathfilter: + cd interchaintest && go test -timeout 30m -race -v -run TestScenarioPathFilter ./... + +interchaintest-scenario-tendermint: + cd interchaintest && go test -timeout 30m -race -v -run TestScenarioTendermint ./... + +interchaintest-scenario-stride: + cd interchaintest && go test -timeout 30m -race -v -run TestScenarioStride ./... coverage: @echo "viewing test coverage..." From d606e3a727f54a7e840eff59b1d70996fd135c9e Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:10:59 -0600 Subject: [PATCH 2/9] use matrix --- .github/workflows/interchaintest.yml | 120 +++++---------------------- Makefile | 16 +--- 2 files changed, 20 insertions(+), 116 deletions(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index 3e88e3dec..3311ad072 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -133,92 +133,28 @@ jobs: - name: interchaintest run: make interchaintest-fee-grant - scenarios-client: - runs-on: ubuntu-latest - steps: - - name: Set up Go 1.21 - uses: actions/setup-go@v4 - with: - go-version: '1.21' - - - name: checkout relayer - uses: actions/checkout@v2 - - - uses: actions/cache@v1 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: interchaintest - run: make interchaintest-scenario-client - - scenarios-ica: - runs-on: ubuntu-latest - steps: - - name: Set up Go 1.21 - uses: actions/setup-go@v4 - with: - go-version: '1.21' - - - name: checkout relayer - uses: actions/checkout@v2 - - - uses: actions/cache@v1 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: interchaintest - run: make interchaintest-scenario-ica - - scenarios-interchainaccounts: + prepare-matrix: runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - - name: Set up Go 1.21 - uses: actions/setup-go@v4 - with: - go-version: '1.21' + - name: Checkout code + uses: actions/checkout@v2 - - name: checkout relayer - uses: actions/checkout@v2 + - name: Generate matrix + id: set-matrix + run: | + # Run the command and convert its output to a JSON array + TESTS=$(go test -list ^TEST | jq -R -s -c 'split("\n")[:-1]') + echo "::set-output name=matrix::${TESTS}" - - uses: actions/cache@v1 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: interchaintest - run: make interchaintest-scenario-interchainaccounts - - scenarios-pathfilter: + scenarios-client: + needs: prepare-matrix runs-on: ubuntu-latest - steps: - - name: Set up Go 1.21 - uses: actions/setup-go@v4 - with: - go-version: '1.21' - - - name: checkout relayer - uses: actions/checkout@v2 - - - uses: actions/cache@v1 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + strategy: + matrix: + test: ${{fromJson(needs.prepare-matrix.outputs.matrix)}} - - name: interchaintest - run: make interchaintest-scenario-pathfilter - - scenarios-tendermint: - runs-on: ubuntu-latest steps: - name: Set up Go 1.21 uses: actions/setup-go@v4 @@ -228,26 +164,7 @@ jobs: - name: checkout relayer uses: actions/checkout@v2 - - uses: actions/cache@v1 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: interchaintest - run: make interchaintest-scenario-tendermint - - scenarios-stride: - runs-on: ubuntu-latest - steps: - - name: Set up Go 1.21 - uses: actions/setup-go@v4 - with: - go-version: '1.21' - - - name: checkout relayer - uses: actions/checkout@v2 + - uses: actions/cache@v1 with: @@ -257,4 +174,5 @@ jobs: ${{ runner.os }}-go- - name: interchaintest - run: make interchaintest-scenario-stride + run: | + go test -run ${{ matrix.test }} diff --git a/Makefile b/Makefile index 074a64326..6d3781c3b 100644 --- a/Makefile +++ b/Makefile @@ -92,23 +92,9 @@ interchaintest-fee-grant: cd interchaintest && go test -race -v -run TestRelayerFeeGrant . ## Scenario tests are suitable for simple networks of 1 validator and no full nodes. They test specific functionality. -interchaintest-scenario-client: +interchaintest-scenario: cd interchaintest && go test -timeout 30m -race -v -run TestScenarioClient ./... -interchaintest-scenario-ica: - cd interchaintest && go test -timeout 30m -race -v -run TestScenarioICA ./... - -interchaintest-scenario-interchainaccounts: - cd interchaintest && go test -timeout 30m -race -v -run TestScenarioInterchainAccounts ./... - -interchaintest-scenario-pathfilter: - cd interchaintest && go test -timeout 30m -race -v -run TestScenarioPathFilter ./... - -interchaintest-scenario-tendermint: - cd interchaintest && go test -timeout 30m -race -v -run TestScenarioTendermint ./... - -interchaintest-scenario-stride: - cd interchaintest && go test -timeout 30m -race -v -run TestScenarioStride ./... coverage: @echo "viewing test coverage..." From a0eddb3b60a7bd2dd3a2883e4ba2a5ac6fc662a6 Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:18:39 -0600 Subject: [PATCH 3/9] updates --- .github/workflows/interchaintest.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index 3311ad072..6a39770d6 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -133,7 +133,7 @@ jobs: - name: interchaintest run: make interchaintest-fee-grant - prepare-matrix: + prepare-scenario-matrix: runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -145,15 +145,15 @@ jobs: id: set-matrix run: | # Run the command and convert its output to a JSON array - TESTS=$(go test -list ^TEST | jq -R -s -c 'split("\n")[:-1]') + TESTS=$(go test -list ^TestScenario | jq -R -s -c 'split("\n")[:-1]') echo "::set-output name=matrix::${TESTS}" - scenarios-client: - needs: prepare-matrix + scenarios: + needs: prepare-scenario-matrix runs-on: ubuntu-latest strategy: matrix: - test: ${{fromJson(needs.prepare-matrix.outputs.matrix)}} + test: ${{fromJson(needs.prepare-scenario-matrix.outputs.matrix)}} steps: - name: Set up Go 1.21 @@ -164,8 +164,6 @@ jobs: - name: checkout relayer uses: actions/checkout@v2 - - - uses: actions/cache@v1 with: path: ~/go/pkg/mod @@ -175,4 +173,5 @@ jobs: - name: interchaintest run: | + cd interchaintest go test -run ${{ matrix.test }} From 5e07c0a10243314d48bf9f1ed276031dd41dcb61 Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:28:46 -0600 Subject: [PATCH 4/9] need to cd into dir first --- .github/workflows/interchaintest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index 6a39770d6..6a93cbef0 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -145,7 +145,7 @@ jobs: id: set-matrix run: | # Run the command and convert its output to a JSON array - TESTS=$(go test -list ^TestScenario | jq -R -s -c 'split("\n")[:-1]') + TESTS=$(cd interchaintest && go test -list ^TestScenario | jq -R -s -c 'split("\n")[:-1]') echo "::set-output name=matrix::${TESTS}" scenarios: From d0e3a2535102e8d31fd0d25939dfabc94425bc40 Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:38:45 -0600 Subject: [PATCH 5/9] handle deprication --- .github/workflows/interchaintest.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index 6a93cbef0..ff3dd91bd 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -146,7 +146,8 @@ jobs: run: | # Run the command and convert its output to a JSON array TESTS=$(cd interchaintest && go test -list ^TestScenario | jq -R -s -c 'split("\n")[:-1]') - echo "::set-output name=matrix::${TESTS}" + echo "matrix=${TESTS}" >> $GITHUB_OUTPUT + scenarios: needs: prepare-scenario-matrix From 11d02630a27f16665eb1f152ff332967b59c4506 Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:46:15 -0600 Subject: [PATCH 6/9] Remove rouge entry into the matrix --- .github/workflows/interchaintest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index ff3dd91bd..4634ba115 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -145,7 +145,7 @@ jobs: id: set-matrix run: | # Run the command and convert its output to a JSON array - TESTS=$(cd interchaintest && go test -list ^TestScenario | jq -R -s -c 'split("\n")[:-1]') + TESTS=$(cd interchaintest && go test -list ^TestScenario | grep -v "^ok " | jq -R -s -c 'split("\n")[:-1]') echo "matrix=${TESTS}" >> $GITHUB_OUTPUT From 12e390082650547bb59e5a9ec7f006952886ac0d Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:54:28 -0600 Subject: [PATCH 7/9] Ensure other parallel tests run to completion even if one of them fail --- .github/workflows/interchaintest.yml | 1 + Makefile | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index 4634ba115..625078efc 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -153,6 +153,7 @@ jobs: needs: prepare-scenario-matrix runs-on: ubuntu-latest strategy: + fail-fast: false matrix: test: ${{fromJson(needs.prepare-scenario-matrix.outputs.matrix)}} diff --git a/Makefile b/Makefile index 6d3781c3b..4693f4688 100644 --- a/Makefile +++ b/Makefile @@ -91,8 +91,7 @@ interchaintest-fee-middleware: interchaintest-fee-grant: cd interchaintest && go test -race -v -run TestRelayerFeeGrant . -## Scenario tests are suitable for simple networks of 1 validator and no full nodes. They test specific functionality. -interchaintest-scenario: +interchaintest-scenario: ## Scenario tests are suitable for simple networks of 1 validator and no full nodes. They test specific functionality. cd interchaintest && go test -timeout 30m -race -v -run TestScenarioClient ./... From d6b9ebed3165c2d03edfa136d2ee5fce87021722 Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 12 Sep 2023 15:58:33 -0600 Subject: [PATCH 8/9] Add explanation --- .github/workflows/interchaintest.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index 625078efc..bf5ad7bba 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -148,7 +148,7 @@ jobs: TESTS=$(cd interchaintest && go test -list ^TestScenario | grep -v "^ok " | jq -R -s -c 'split("\n")[:-1]') echo "matrix=${TESTS}" >> $GITHUB_OUTPUT - + # Note : This job will not start until prepare-scenario-matrix completes sucessfully scenarios: needs: prepare-scenario-matrix runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 4693f4688..d66df7fdb 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ interchaintest-fee-grant: cd interchaintest && go test -race -v -run TestRelayerFeeGrant . interchaintest-scenario: ## Scenario tests are suitable for simple networks of 1 validator and no full nodes. They test specific functionality. - cd interchaintest && go test -timeout 30m -race -v -run TestScenarioClient ./... + cd interchaintest && go test -timeout 30m -race -v -run TestScenario ./... coverage: From d34225dc96b9a8db356de04359602293dfaaaa3c Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:05:13 -0600 Subject: [PATCH 9/9] Remove rougue whitespace --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index d66df7fdb..20e9bbb2b 100644 --- a/Makefile +++ b/Makefile @@ -94,7 +94,6 @@ interchaintest-fee-grant: interchaintest-scenario: ## Scenario tests are suitable for simple networks of 1 validator and no full nodes. They test specific functionality. cd interchaintest && go test -timeout 30m -race -v -run TestScenario ./... - coverage: @echo "viewing test coverage..." @go tool cover --html=coverage.out