From 2aa59be4fbe3fcb796b94b60dc8a3e4c487b671c Mon Sep 17 00:00:00 2001 From: vimystic <122659254+vimystic@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:33:40 -0600 Subject: [PATCH] Split scenarios test (#1294) * Split scenarios test * use matrix * updates * need to cd into dir first * handle deprication * Remove rouge entry into the matrix * Ensure other parallel tests run to completion even if one of them fail * Add explanation * Remove rougue whitespace --- .github/workflows/interchaintest.yml | 30 +++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/interchaintest.yml b/.github/workflows/interchaintest.yml index f7f9c4d6a..bf5ad7bba 100644 --- a/.github/workflows/interchaintest.yml +++ b/.github/workflows/interchaintest.yml @@ -133,8 +133,30 @@ jobs: - name: interchaintest run: make interchaintest-fee-grant + prepare-scenario-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Generate matrix + id: set-matrix + run: | + # Run the command and convert its output to a JSON array + 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 + strategy: + fail-fast: false + matrix: + test: ${{fromJson(needs.prepare-scenario-matrix.outputs.matrix)}} + steps: - name: Set up Go 1.21 uses: actions/setup-go@v4 @@ -152,8 +174,6 @@ jobs: ${{ runner.os }}-go- - name: interchaintest - run: make interchaintest-scenario - - - name: Prune Docker images - if: always() #ensure dangling images are pruned after interchain-test scenario passes or fails - run: docker image prune -f + run: | + cd interchaintest + go test -run ${{ matrix.test }}