Skip to content

Commit e5aaad0

Browse files
Copilotkobenguyent
andcommitted
Changes before error encountered
Co-authored-by: kobenguyent <[email protected]>
1 parent 0971ac9 commit e5aaad0

File tree

3 files changed

+11
-121
lines changed

3 files changed

+11
-121
lines changed
Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Acceptance Tests with Sharding
1+
name: Acceptance Tests
22

33
on:
44
push:
@@ -14,10 +14,8 @@ env:
1414
FORCE_COLOR: 1
1515

1616
jobs:
17-
# Traditional docker-compose tests (kept for compatibility)
18-
docker-tests:
17+
build:
1918
runs-on: ubuntu-latest
20-
name: Docker-based Tests
2119

2220
strategy:
2321
matrix:
@@ -48,65 +46,3 @@ jobs:
4846
- name: Run Faker BDD Tests
4947
run: docker-compose run --rm test-bdd.faker
5048
working-directory: test
51-
52-
# New sharded acceptance tests using CodeceptJS directly
53-
sharded-acceptance-tests:
54-
runs-on: ubuntu-latest
55-
name: 'Sharded Tests: ${{ matrix.config }} (Shard ${{ matrix.shard }})'
56-
57-
strategy:
58-
fail-fast: false
59-
matrix:
60-
node-version: [20.x]
61-
config: ['codecept.Puppeteer.js', 'codecept.Playwright.js']
62-
shard: ['1/2', '2/2']
63-
64-
steps:
65-
- name: Checkout Repository
66-
uses: actions/checkout@v5
67-
68-
- name: Use Node.js ${{ matrix.node-version }}
69-
uses: actions/setup-node@v4
70-
with:
71-
node-version: ${{ matrix.node-version }}
72-
73-
- name: Setup PHP
74-
uses: shivammathur/setup-php@v2
75-
with:
76-
php-version: 7.4
77-
78-
- name: Install dependencies
79-
run: npm install --ignore-scripts
80-
env:
81-
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
82-
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
83-
84-
- name: Setup Chrome
85-
uses: browser-actions/setup-chrome@v1
86-
87-
- name: Install Playwright Browsers
88-
if: contains(matrix.config, 'Playwright')
89-
run: npx playwright install chromium --with-deps
90-
91-
- name: Verify browser setup
92-
run: |
93-
which google-chrome || which chromium-browser || echo "Chrome not found in PATH"
94-
95-
- name: Start PHP Server
96-
run: |
97-
php -S 127.0.0.1:8000 -t test/data/app &
98-
sleep 2
99-
# Wait for server to be ready
100-
timeout 10 bash -c 'until curl -s http://127.0.0.1:8000 >/dev/null; do sleep 1; done' || echo "Server may not be fully ready"
101-
102-
- name: Run Acceptance Tests with Sharding
103-
run: npx codeceptjs run --config ./test/acceptance/${{ matrix.config }} --shard ${{ matrix.shard }} --verbose
104-
env:
105-
FORCE_COLOR: 1
106-
DONT_FAIL_ON_EMPTY_RUN: true
107-
108-
- name: Display Test Info
109-
run: |
110-
echo "Configuration: ${{ matrix.config }}"
111-
echo "Shard: ${{ matrix.shard }}"
112-
echo "This demonstrates test sharding across different browser configurations"
Lines changed: 8 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Sharding Demonstration
1+
name: Minimal Sharding Test
22

33
on:
44
push:
@@ -13,73 +13,27 @@ env:
1313
FORCE_COLOR: 1
1414

1515
jobs:
16-
# Demonstrate sharding with sandbox tests (FileSystem-based, no browser needed)
17-
sharded-sandbox-tests:
16+
test-sharding:
1817
runs-on: ubuntu-latest
19-
name: 'Sandbox Tests (Shard ${{ matrix.shard }})'
18+
name: 'Shard ${{ matrix.shard }}'
2019

2120
strategy:
2221
fail-fast: false
2322
matrix:
24-
node-version: [20.x]
25-
# Split sandbox tests across 2 shards
2623
shard: ['1/2', '2/2']
2724

2825
steps:
29-
- name: Checkout Repository
26+
- name: Checkout
3027
uses: actions/checkout@v5
3128

32-
- name: Use Node.js ${{ matrix.node-version }}
29+
- name: Setup Node.js
3330
uses: actions/setup-node@v4
3431
with:
35-
node-version: ${{ matrix.node-version }}
32+
node-version: 20
3633

3734
- name: Install dependencies
3835
run: npm install --ignore-scripts
3936

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 }}
4239
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 }})"

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ jobs:
4949
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
5050
- run: npm run test:runner
5151
# Note: Runner tests are mocha-based, so sharding doesn't apply here.
52-
# Sharding is specifically for CodeceptJS tests (see sharding-demo.yml for examples)
52+
# For CodeceptJS sharding examples, see sharding-demo.yml workflow.

0 commit comments

Comments
 (0)