Skip to content

Commit

Permalink
chore(git): speed up tests by executing in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Sep 25, 2024
1 parent 91e49af commit 3e7915e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
- run: yarn ${{ matrix.command }}

test:
strategy:
matrix:
suite: [unit, web, esm, cjs]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -48,16 +51,22 @@ jobs:
run: yarn --immutable --immutable-cache

- name: Run tests
run: yarn test
run: yarn test:${{ matrix.suite }}

- name: Upload coverage
if: matrix.suite == 'unit'
uses: codecov/codecov-action@v4.0.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

notify:
needs: [build, test]
if: success()
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: ${{ job.status == 'success' && 'Build / E2E tests succeeded!' || 'Build / E2E tests failed!' }}
SLACK_COLOR: ${{ job.status == 'success' && 'good' || 'danger' }}
SLACK_TITLE: 'Build / E2E tests succeeded!'
SLACK_COLOR: 'good'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@
"format": "prettier --check .",
"format:fix": "prettier --write .",
"test": "yarn test:unit && yarn test:e2e",
"test:cjs": "cd ./tests/e2e/cjs && yarn && yarn test",
"test:esm": "cd ./tests/e2e/esm && yarn && yarn test",
"test:web": "cd ./tests/e2e/web && yarn && yarn test",
"test:cjs": "yarn test:link && cd ./tests/e2e/cjs && yarn && yarn test",
"test:esm": "yarn test:link && cd ./tests/e2e/esm && yarn && yarn test",
"test:web": "yarn test:link && cd ./tests/e2e/web && yarn && yarn test",
"test:unit": "NODE_OPTIONS=\"--import=./register.mjs\" node --test tests/unit/**.test.ts",
"test:link": "yarn build && yarn link",
"test:e2e": "yarn test:link && yarn test:cjs && yarn test:esm && yarn test:web",
"test:e2e": "yarn test:cjs && yarn test:esm && yarn test:web",
"prepare": "husky install",
"example:esm": "cd examples/esm && yarn && node index.mjs",
"example:cjs": "yarn test:link && cd examples/cjs && yarn && node index.cjs",
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/web/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('ESM browser validation', () => {
.withBuild()
.withWaitStrategy('ao-cu-1', Wait.forHttp('/', 6363))
.up(['ao-cu']);
});
}, 120_000);
it('should load the app and SDK', async () => {
await act(async () => render(<App />));

Expand Down

0 comments on commit 3e7915e

Please sign in to comment.