Skip to content

Commit

Permalink
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 fd996e3 commit 2b81eff
Showing 1 changed file with 45 additions and 123 deletions.
168 changes: 45 additions & 123 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 @@ -197,6 +194,12 @@ jobs:
- name: yarn test (vow)
if: (success() || failure())
run: cd packages/vow && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: yarn test (xsnap-lockdown)
if: (success() || failure())
run: cd packages/xsnap-lockdown && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: yarn test (xsnap)
if: (success() || failure())
run: cd packages/xsnap && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: notify on failure
if: failure() && github.event_name != 'pull_request'
uses: ./.github/actions/notify-status
Expand Down Expand Up @@ -334,14 +337,14 @@ jobs:

##############
# Long-running tests are executed individually.
test-solo:
test-governance:
# BEGIN-TEST-BOILERPLATE
timeout-minutes: 30
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
# test:xs is noop in solo/package.json
# test:xs is noop in governance/package.json
engine: ['18.x', '20.x']
steps:
- name: set vars
Expand All @@ -356,9 +359,9 @@ jobs:
with:
node-version: ${{ steps.vars.outputs.node-version }}
# END-TEST-BOILERPLATE
- name: yarn test (solo)
- name: yarn test (governance)
if: (success() || failure())
run: cd packages/solo && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
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
Expand All @@ -375,15 +378,15 @@ jobs:
datadog-token: ${{ secrets.DATADOG_API_KEY }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}

test-cosmic-swingset:
test-solo:
# BEGIN-TEST-BOILERPLATE
timeout-minutes: 30
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
# test:xs is noop in cosmic-swingset/package.json
engine: ['18.x', '20.x', 'xs']
# test:xs is noop in solo/package.json
engine: ['18.x', '20.x']
steps:
- name: set vars
id: vars
Expand All @@ -397,12 +400,9 @@ jobs:
with:
node-version: ${{ steps.vars.outputs.node-version }}
# END-TEST-BOILERPLATE
- uses: ./.github/actions/restore-golang
with:
go-version: '1.20'
- name: yarn test (cosmic-swingset)
- name: yarn test (solo)
if: (success() || failure())
run: cd packages/cosmic-swingset && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
run: cd packages/solo && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: notify on failure
if: failure() && github.event_name != 'pull_request'
uses: ./.github/actions/notify-status
Expand All @@ -419,15 +419,15 @@ jobs:
datadog-token: ${{ secrets.DATADOG_API_KEY }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}

test-inter-protocol:
test-cosmic-swingset:
# BEGIN-TEST-BOILERPLATE
timeout-minutes: 30
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
# test:xs is noop in inter-protocol/package.json
engine: ['18.x', '20.x']
# test:xs is noop in cosmic-swingset/package.json
engine: ['18.x', '20.x', 'xs']
steps:
- name: set vars
id: vars
Expand All @@ -441,9 +441,12 @@ jobs:
with:
node-version: ${{ steps.vars.outputs.node-version }}
# END-TEST-BOILERPLATE
- name: yarn test (inter-protocol)
- uses: ./.github/actions/restore-golang
with:
go-version: '1.20'
- name: yarn test (cosmic-swingset)
if: (success() || failure())
run: cd packages/inter-protocol && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
run: cd packages/cosmic-swingset && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: notify on failure
if: failure() && github.event_name != 'pull_request'
uses: ./.github/actions/notify-status
Expand All @@ -460,14 +463,15 @@ jobs:
datadog-token: ${{ secrets.DATADOG_API_KEY }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}

test-boot:
test-inter-protocol:
# BEGIN-TEST-BOILERPLATE
timeout-minutes: 40
timeout-minutes: 30
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
engine: ['18.x', '20.x', 'xs']
# test:xs is noop in inter-protocol/package.json
engine: ['18.x', '20.x']
steps:
- name: set vars
id: vars
Expand All @@ -481,9 +485,9 @@ jobs:
with:
node-version: ${{ steps.vars.outputs.node-version }}
# END-TEST-BOILERPLATE
- name: yarn test (boot)
- name: yarn test (inter-protocol)
if: (success() || failure())
run: cd packages/boot && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
run: cd packages/inter-protocol && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: notify on failure
if: failure() && github.event_name != 'pull_request'
uses: ./.github/actions/notify-status
Expand All @@ -500,33 +504,35 @@ jobs:
datadog-token: ${{ secrets.DATADOG_API_KEY }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}

# The test-swingset* tests are split by alphabetical test name.
test-swingset:
test-boot:
# BEGIN-TEST-BOILERPLATE
timeout-minutes: 30
timeout-minutes: 40
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
engine: ['18.x', '20.x', 'xs']
# Run parallel testing jobs, each executing a subset.
node_index: [0, 1, 2, 3]
total_nodes: [4] # the total number of nodes
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
echo "CI_NODE_INDEX=${{ matrix.node_index }}" >> $GITHUB_ENV
echo "CI_NODE_TOTAL=${{ matrix.total_nodes }}" >> $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)
- name: yarn test (boot)
if: (success() || failure())
run: cd packages/SwingSet && yarn ${{ steps.vars.outputs.test }} 'test/**/[A-Da-d]*' | $TEST_COLLECT
run: cd packages/boot && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: notify on failure
if: failure() && github.event_name != 'pull_request'
uses: ./.github/actions/notify-status
Expand All @@ -543,21 +549,26 @@ jobs:
datadog-token: ${{ secrets.DATADOG_API_KEY }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}

test-swingset2:
test-swingset:
# BEGIN-TEST-BOILERPLATE
timeout-minutes: 30
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
engine: ['18.x', '20.x', 'xs']
# Run parallel testing jobs, each executing a subset.
node_index: [0, 1, 2, 3, 4]
total_nodes: [5] # the total number of nodes
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
echo "CI_NODE_INDEX=${{ matrix.node_index }}" >> $GITHUB_ENV
echo "CI_NODE_TOTAL=${{ matrix.total_nodes }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: ./.github/actions/restore-node
Expand All @@ -568,13 +579,7 @@ jobs:
# END-TEST-BOILERPLATE
- name: yarn test (SwingSet)
if: (success() || failure())
run: cd packages/SwingSet && yarn ${{ steps.vars.outputs.test }} 'test/**/[E-Ie-i]*' | $TEST_COLLECT
- name: yarn test (xsnap-lockdown)
if: (success() || failure())
run: cd packages/xsnap-lockdown && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: yarn test (xsnap)
if: (success() || failure())
run: cd packages/xsnap && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
run: cd packages/SwingSet && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
# explicitly test the XS worker, for visibility
- name: yarn test (SwingSet XS Worker)
if: (success() || failure()) && matrix.engine != 'xs'
Expand All @@ -595,89 +600,6 @@ jobs:
datadog-token: ${{ secrets.DATADOG_API_KEY }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}

test-swingset3:
# 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/**/[J-Rj-r]*' | $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-swingset4:
# 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/**/[S-Zs-z0-9.test]*.js' | $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-zoe-unit:
# BEGIN-TEST-BOILERPLATE
timeout-minutes: 30
Expand Down

0 comments on commit 2b81eff

Please sign in to comment.