From 6a44aefbea76ff4d84ee29b5382795318317882a Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Sat, 15 Jun 2024 18:52:45 -0600 Subject: [PATCH] fixup! ci(all-packages): split tests according to AVA recipe --- .github/workflows/test-all-packages.yml | 112 +++++++++++++++++++++--- 1 file changed, 101 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-all-packages.yml b/.github/workflows/test-all-packages.yml index 4c9fcb58714..5c898b588ad 100644 --- a/.github/workflows/test-all-packages.yml +++ b/.github/workflows/test-all-packages.yml @@ -164,9 +164,6 @@ jobs: - name: yarn test (ERTP) if: (success() || failure()) run: cd packages/ERTP && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT - - name: yarn test (governance) - if: (success() || failure()) - run: cd packages/governance && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT - name: yarn test (import-manager) if: (success() || failure()) run: cd packages/import-manager && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT @@ -334,6 +331,47 @@ jobs: ############## # Long-running tests are executed individually. + test-governance: + # BEGIN-TEST-BOILERPLATE + timeout-minutes: 30 + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + # test:xs is noop in governance/package.json + engine: ['18.x', '20.x'] + steps: + - name: set vars + id: vars + run: | + echo "node-version=${{ matrix.engine == 'xs' && '18.x' || matrix.engine }}" >> $GITHUB_OUTPUT + echo "test=${{ matrix.engine == 'xs' && 'test:xs' || 'test' }}" >> $GITHUB_OUTPUT + echo "GH_ENGINE=${{ matrix.engine }}" >> $GITHUB_ENV + + - uses: actions/checkout@v4 + - uses: ./.github/actions/restore-node + with: + node-version: ${{ steps.vars.outputs.node-version }} + # END-TEST-BOILERPLATE + - name: yarn test (governance) + if: (success() || failure()) + run: cd packages/governance && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT + - name: notify on failure + if: failure() && github.event_name != 'pull_request' + uses: ./.github/actions/notify-status + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + from: ${{ secrets.NOTIFY_EMAIL_FROM }} + to: ${{ secrets.NOTIFY_EMAIL_TO }} + password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }} + - uses: ./.github/actions/post-test + if: (success() || failure()) + continue-on-error: true + timeout-minutes: 4 + with: + datadog-token: ${{ secrets.DATADOG_API_KEY }} + codecov-token: ${{ secrets.CODECOV_TOKEN }} + test-solo: # BEGIN-TEST-BOILERPLATE timeout-minutes: 30 @@ -534,14 +572,14 @@ jobs: run: cd packages/SwingSet && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT env: CI_NODE_INDEX: 0 - CI_NODE_TOTAL: 4 + CI_NODE_TOTAL: 5 # explicitly test the XS worker, for visibility - name: yarn test (SwingSet XS Worker) if: (success() || failure()) && matrix.engine != 'xs' run: cd packages/SwingSet && yarn test:xs-worker | $TEST_COLLECT env: CI_NODE_INDEX: 0 - CI_NODE_TOTAL: 4 + CI_NODE_TOTAL: 5 - name: notify on failure if: failure() && github.event_name != 'pull_request' uses: ./.github/actions/notify-status @@ -586,14 +624,14 @@ jobs: run: cd packages/SwingSet && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT env: CI_NODE_INDEX: 1 - CI_NODE_TOTAL: 4 + CI_NODE_TOTAL: 5 # explicitly test the XS worker, for visibility - name: yarn test (SwingSet XS Worker) if: (success() || failure()) && matrix.engine != 'xs' run: cd packages/SwingSet && yarn test:xs-worker | $TEST_COLLECT env: CI_NODE_INDEX: 1 - CI_NODE_TOTAL: 4 + CI_NODE_TOTAL: 5 - name: yarn test (xsnap-lockdown) if: (success() || failure()) run: cd packages/xsnap-lockdown && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT @@ -643,14 +681,14 @@ jobs: run: cd packages/SwingSet && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT env: CI_NODE_INDEX: 2 - CI_NODE_TOTAL: 4 + CI_NODE_TOTAL: 5 # explicitly test the XS worker, for visibility - name: yarn test (SwingSet XS Worker) if: (success() || failure()) && matrix.engine != 'xs' run: cd packages/SwingSet && yarn test:xs-worker | $TEST_COLLECT env: CI_NODE_INDEX: 2 - CI_NODE_TOTAL: 4 + CI_NODE_TOTAL: 5 - name: notify on failure if: failure() && github.event_name != 'pull_request' uses: ./.github/actions/notify-status @@ -695,14 +733,66 @@ jobs: run: cd packages/SwingSet && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT env: CI_NODE_INDEX: 3 - CI_NODE_TOTAL: 4 + CI_NODE_TOTAL: 5 # explicitly test the XS worker, for visibility - name: yarn test (SwingSet XS Worker) if: (success() || failure()) && matrix.engine != 'xs' run: cd packages/SwingSet && yarn test:xs-worker | $TEST_COLLECT env: CI_NODE_INDEX: 3 - CI_NODE_TOTAL: 4 + CI_NODE_TOTAL: 5 + - name: notify on failure + if: failure() && github.event_name != 'pull_request' + uses: ./.github/actions/notify-status + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + from: ${{ secrets.NOTIFY_EMAIL_FROM }} + to: ${{ secrets.NOTIFY_EMAIL_TO }} + password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }} + - uses: ./.github/actions/post-test + if: (success() || failure()) + continue-on-error: true + timeout-minutes: 4 + with: + datadog-token: ${{ secrets.DATADOG_API_KEY }} + codecov-token: ${{ secrets.CODECOV_TOKEN }} + + test-swingset5: + # BEGIN-TEST-BOILERPLATE + timeout-minutes: 30 + needs: build + runs-on: ubuntu-latest + strategy: + matrix: + engine: ['18.x', '20.x', 'xs'] + steps: + - name: set vars + id: vars + run: | + echo "node-version=${{ matrix.engine == 'xs' && '18.x' || matrix.engine }}" >> $GITHUB_OUTPUT + echo "test=${{ matrix.engine == 'xs' && 'test:xs' || 'test' }}" >> $GITHUB_OUTPUT + echo "GH_ENGINE=${{ matrix.engine }}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + - uses: ./.github/actions/restore-node + with: + node-version: ${{ steps.vars.outputs.node-version }} + id: restore-node + - run: echo "ENDO_BRANCH=${{ steps.restore-node.outputs.endo-branch }}" >> $GITHUB_ENV + # END-TEST-BOILERPLATE + + - name: yarn test (SwingSet) + if: (success() || failure()) + run: cd packages/SwingSet && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT + env: + CI_NODE_INDEX: 4 + CI_NODE_TOTAL: 5 + # explicitly test the XS worker, for visibility + - name: yarn test (SwingSet XS Worker) + if: (success() || failure()) && matrix.engine != 'xs' + run: cd packages/SwingSet && yarn test:xs-worker | $TEST_COLLECT + env: + CI_NODE_INDEX: 4 + CI_NODE_TOTAL: 5 - name: notify on failure if: failure() && github.event_name != 'pull_request' uses: ./.github/actions/notify-status