Skip to content

Commit dd974ac

Browse files
authored
Add parallel test execution workflow and update .gitignore for test plans (#496)
* Add parallel test execution workflow and update .gitignore for test plans * update bun test yml * Update test workflow to include node 5 and modify test execution logic * format * testing diff approach * testing diff approach * Trying bun test instead
1 parent 0025886 commit dd974ac

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

.github/workflows/bun-test.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ jobs:
88
test:
99
runs-on: ubuntu-latest
1010
timeout-minutes: 15
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
node: [1, 2, 3, 4, 5]
1115

1216
steps:
1317
- name: Checkout code
@@ -21,14 +25,28 @@ jobs:
2125
- name: Install dependencies
2226
run: bun install
2327

24-
- name: Run tests
25-
run: bun test --timeout 300000
28+
- name: Install bun-test-plan
29+
run: npm install -g @tscircuit/bun-test-plan
30+
31+
- name: Generate test plans
32+
run: bun-test-plan
33+
34+
- name: Run tests for node ${{ matrix.node }}
35+
run: |
36+
if [ "${{ matrix.node }}" = "1" ]; then
37+
# Node 1: Run only the long-running test
38+
bun test tests/bugs/bugreport23.test.ts --timeout 300000
39+
else
40+
# Other nodes: Run from generated test plan
41+
mapfile -t test_files < .bun-test-plan/testplans/testplan${{ matrix.node }}.txt
42+
bun test "${test_files[@]}" --timeout 300000
43+
fi
2644
2745
- name: Upload diff PNG and SVG snapshot artifacts
2846
if: failure()
2947
uses: actions/upload-artifact@v4
3048
with:
31-
name: diff-png-and-snap-svg-artifacts
49+
name: diff-png-and-snap-svg-artifacts-node${{ matrix.node }}
3250
path: |
3351
**/*.diff.png
3452
**/*.snap.svg

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,6 @@ cosmos-export
184184
.yalc
185185
yalc.lock
186186
**/.claude/settings.local.json
187+
188+
# Generated test plans
189+
.bun-test-plan/

bun-test-plan.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"nodeCount": 5,
3+
"globPatterns": ["tests/bugs/bugreport23.test.ts", "tests/**/*.test.{ts,tsx}"]
4+
}

0 commit comments

Comments
 (0)