|
1 | | -name: Test Sharding Demonstration |
| 1 | +name: Minimal Sharding Test |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
13 | 13 | FORCE_COLOR: 1 |
14 | 14 |
|
15 | 15 | jobs: |
16 | | - # Demonstrate sharding with sandbox tests (FileSystem-based, no browser needed) |
17 | | - sharded-sandbox-tests: |
| 16 | + test-sharding: |
18 | 17 | runs-on: ubuntu-latest |
19 | | - name: 'Sandbox Tests (Shard ${{ matrix.shard }})' |
| 18 | + name: 'Shard ${{ matrix.shard }}' |
20 | 19 |
|
21 | 20 | strategy: |
22 | 21 | fail-fast: false |
23 | 22 | matrix: |
24 | | - node-version: [20.x] |
25 | | - # Split sandbox tests across 2 shards |
26 | 23 | shard: ['1/2', '2/2'] |
27 | 24 |
|
28 | 25 | steps: |
29 | | - - name: Checkout Repository |
| 26 | + - name: Checkout |
30 | 27 | uses: actions/checkout@v5 |
31 | 28 |
|
32 | | - - name: Use Node.js ${{ matrix.node-version }} |
| 29 | + - name: Setup Node.js |
33 | 30 | uses: actions/setup-node@v4 |
34 | 31 | with: |
35 | | - node-version: ${{ matrix.node-version }} |
| 32 | + node-version: 20 |
36 | 33 |
|
37 | 34 | - name: Install dependencies |
38 | 35 | run: npm install --ignore-scripts |
39 | 36 |
|
40 | | - - name: Run Sandbox Tests with Sharding |
41 | | - run: npx codeceptjs run --config ./codecept.js --shard ${{ matrix.shard }} --verbose |
| 37 | + - name: Run tests with sharding |
| 38 | + run: npx codeceptjs run --config ./codecept.js --shard ${{ matrix.shard }} |
42 | 39 | working-directory: test/data/sandbox |
43 | | - env: |
44 | | - FORCE_COLOR: 1 |
45 | | - DONT_FAIL_ON_EMPTY_RUN: true |
46 | | - |
47 | | - - name: Display Shard Info |
48 | | - run: | |
49 | | - echo "This shard (${{ matrix.shard }}) ran a subset of the available test files" |
50 | | - echo "All shards together cover the complete test suite without duplication" |
51 | | -
|
52 | | - # Show combination with shuffle option |
53 | | - sharded-shuffled-tests: |
54 | | - runs-on: ubuntu-latest |
55 | | - name: 'Shuffled + Sharded Tests (Shard ${{ matrix.shard }})' |
56 | | - |
57 | | - strategy: |
58 | | - fail-fast: false |
59 | | - matrix: |
60 | | - node-version: [20.x] |
61 | | - shard: ['1/2', '2/2'] |
62 | | - |
63 | | - steps: |
64 | | - - name: Checkout Repository |
65 | | - uses: actions/checkout@v5 |
66 | | - |
67 | | - - name: Use Node.js ${{ matrix.node-version }} |
68 | | - uses: actions/setup-node@v4 |
69 | | - with: |
70 | | - node-version: ${{ matrix.node-version }} |
71 | | - |
72 | | - - name: Install dependencies |
73 | | - run: npm install --ignore-scripts |
74 | | - |
75 | | - - name: Run Tests with Shuffle + Sharding |
76 | | - run: npx codeceptjs run --config ./codecept.js --shuffle --shard ${{ matrix.shard }} --verbose |
77 | | - working-directory: test/data/sandbox |
78 | | - env: |
79 | | - FORCE_COLOR: 1 |
80 | | - DONT_FAIL_ON_EMPTY_RUN: true |
81 | | - |
82 | | - - name: Display Combined Options Info |
83 | | - run: | |
84 | | - echo "This demonstrates sharding combined with shuffle option" |
85 | | - echo "Tests are first shuffled, then sharded for this worker (${{ matrix.shard }})" |
0 commit comments