Skip to content

Commit

Permalink
fixup! ci(all-packages): split tests according to AVA recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Jun 16, 2024
1 parent 359485e commit 6a44aef
Showing 1 changed file with 101 additions and 11 deletions.
112 changes: 101 additions & 11 deletions .github/workflows/test-all-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6a44aef

Please sign in to comment.