Skip to content

Commit c941dab

Browse files
committed
chore: getting parallelism to work correctly
1 parent deb81ce commit c941dab

File tree

6 files changed

+284
-154
lines changed

6 files changed

+284
-154
lines changed

.circleci/config.yml

Lines changed: 109 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ executors:
88
node:
99
docker:
1010
- image: mcr.microsoft.com/playwright:v1.53.1-noble
11-
resource_class: xlarge
1211
environment:
1312
NODE_ENV: development
1413
AZCOPY_AUTO_LOGIN_TYPE: SPN
@@ -48,22 +47,24 @@ commands:
4847
echo 'export AZCOPY_TENANT_ID="$AZURE_TENANT_ID"' >> $BASH_ENV
4948
source $BASH_ENV
5049
azcopy --version
51-
downstream:
50+
setup-project:
5251
steps:
5352
- checkout
54-
# - restore_cache:
55-
# keys:
56-
# - v4c-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
57-
# - restore_cache:
58-
# keys:
59-
# - v4b-<< pipeline.parameters.wireit_cache_name >>-{{ arch }}-{{ checksum "package.json" }}-
53+
- restore_cache:
54+
keys:
55+
- v4c-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
56+
- v4c-dependencies-{{ arch }}-
57+
- restore_cache:
58+
keys:
59+
- v4b-<< pipeline.parameters.wireit_cache_name >>-{{ arch }}-{{ checksum "package.json" }}-
60+
- v4b-<< pipeline.parameters.wireit_cache_name >>-{{ arch }}-
6061
- run:
61-
name: Installing Dependencies
62+
name: Installing dependencies
6263
command: |
6364
corepack enable
6465
yarn --immutable
6566
- run:
66-
name: Build the project
67+
name: Build project
6768
command: yarn build
6869

6970
- save_cache:
@@ -74,9 +75,52 @@ commands:
7475
- save_cache:
7576
paths:
7677
- .wireit
77-
key: v4b-wireit-{{ arch }}-{{ checksum "package.json" }}-{{ epoch }}
78+
key: v4b-<< pipeline.parameters.wireit_cache_name >>-{{ arch }}-{{ checksum "package.json" }}-{{ epoch }}
7879
- attach_workspace:
7980
at: /
81+
82+
run-tests:
83+
description: 'Run tests with CircleCI test splitting'
84+
parameters:
85+
config_file:
86+
type: string
87+
test_patterns:
88+
type: string
89+
exclude_pattern:
90+
type: string
91+
default: ''
92+
steps:
93+
- run:
94+
name: Run tests
95+
command: |
96+
mkdir -p /root/project/results
97+
# Get test files using proper space-separated patterns
98+
TEST_FILES=$(circleci tests glob << parameters.test_patterns >>)
99+
# Apply exclusions if specified and not empty
100+
EXCLUDE_PATTERN="<< parameters.exclude_pattern >>"
101+
if [ -n "$EXCLUDE_PATTERN" ] && [ "$EXCLUDE_PATTERN" != "" ]; then
102+
echo "Applying exclude pattern: $EXCLUDE_PATTERN"
103+
TEST_FILES=$(echo "$TEST_FILES" | grep -v -E "$EXCLUDE_PATTERN")
104+
fi
105+
# Check if we have any test files left
106+
if [ -z "$TEST_FILES" ]; then
107+
echo "No test files found after filtering"
108+
exit 1
109+
fi
110+
# Debug output
111+
echo "Test files to run:"
112+
echo "$TEST_FILES"
113+
# Run tests with CircleCI splitting
114+
echo "$TEST_FILES" | circleci tests run \
115+
--command="xargs yarn test:start --files --config << parameters.config_file >>" \
116+
--split-by=timings \
117+
--verbose
118+
- store_test_results:
119+
path: /root/project/results/
120+
- store_artifacts:
121+
path: /root/project/results/
122+
destination: test-results
123+
80124
run-regressions:
81125
parameters:
82126
regression_system:
@@ -205,79 +249,72 @@ commands:
205249
key: v2-golden-images-{{ .Branch }}-<< parameters.regression_system >>-<< parameters.regression_color >>-<< parameters.regression_scale >>-<< parameters.regression_dir >>-{{ epoch }}
206250

207251
jobs:
252+
lint:
253+
executor: node
254+
resource_class: medium
255+
steps:
256+
- setup-project
257+
- run:
258+
name: Lint
259+
command: yarn lint
260+
- run:
261+
name: Check for changes
262+
command: git diff-files --exit-code
263+
208264
test-chromium:
209265
executor: node
210266
parallelism: 5
267+
resource_class: large
211268

212269
steps:
213-
- downstream
214-
- run:
215-
name: Run unit tests
216-
command: |
217-
TEST=$(circleci tests glob packages/*/test/*.test.js | circleci tests split --split-by=timings)
218-
yarn test:start --files $TEST --config web-test-runner.config.ci-chromium.js --group no-memory-ci
219-
- store_test_results:
220-
path: /root/project/results/
270+
- setup-project
271+
- run-tests:
272+
config_file: web-test-runner.config.ci-chromium.js
273+
test_patterns: 'packages/*/test/*.test.js tools/*/test/*.test.js'
274+
exclude_pattern: 'memory\.test\.js'
221275

222276
test-chromium-memory:
223277
executor: node
224278
parallelism: 5
279+
resource_class: xlarge
225280

226281
steps:
227-
- downstream
228-
- run:
229-
name: Run memory tests
230-
command: |
231-
TEST=$(circleci tests glob packages/*/test/*.test.js | circleci tests split --split-by=timings)
232-
yarn test:start --files $TEST --config web-test-runner.config.ci-chromium.js --group memory-ci
233-
- store_test_results:
234-
path: /root/project/results/
282+
- setup-project
283+
- run-tests:
284+
config_file: web-test-runner.config.ci-chromium.js
285+
test_patterns: 'packages/**/*-memory.test.js tools/**/*-memory.test.js'
286+
exclude_pattern: 'color-area|color-wheel|color-slider|color-loupe|color-handle'
235287

236288
test-firefox:
237289
executor: node
238290
parallelism: 5
291+
resource_class: large
239292

240293
steps:
241-
- downstream
242-
- run:
243-
name: Run tests
244-
command: |
245-
TEST=$(circleci tests glob packages/*/test/*.test.js | circleci tests split --split-by=timings)
246-
yarn test:start --files $TEST --config web-test-runner.config.ci-firefox.js --group no-memory-ci
247-
- store_test_results:
248-
path: /root/project/results/
294+
- setup-project
295+
- run-tests:
296+
config_file: web-test-runner.config.ci-firefox.js
297+
test_patterns: 'packages/*/test/*.test.js tools/*/test/*.test.js'
298+
exclude_pattern: 'memory\.test\.js'
249299

250300
test-webkit:
251301
executor: node
252302
parallelism: 5
303+
resource_class: large
253304

254305
steps:
255-
- downstream
256-
- run:
257-
name: Run tests
258-
command: |
259-
TEST=$(circleci tests glob packages/*/test/*.test.js | circleci tests split --split-by=timings)
260-
yarn test:start --files $TEST --config web-test-runner.config.ci-webkit.js --group no-memory-ci
261-
- store_test_results:
262-
path: /root/project/results/
263-
264-
lint:
265-
executor: node
266-
267-
steps:
268-
- downstream
269-
- run:
270-
name: Lint
271-
command: yarn lint
272-
- run:
273-
name: Are there changes?
274-
command: git diff-files --exit-code
306+
- setup-project
307+
- run-tests:
308+
config_file: web-test-runner.config.ci-webkit.js
309+
test_patterns: 'packages/*/test/*.test.js tools/*/test/*.test.js'
310+
exclude_pattern: 'memory\.test\.js'
275311

276312
beta-docs:
277313
executor: node
314+
resource_class: medium
278315

279316
steps:
280-
- downstream
317+
- setup-project
281318
- run:
282319
name: Generate Custom Elements Manifest
283320
command: yarn docs:analyze
@@ -319,9 +356,10 @@ jobs:
319356
320357
hcm-visual:
321358
executor: node
359+
resource_class: xlarge
322360

323361
steps:
324-
- downstream
362+
- setup-project
325363
- restore_cache:
326364
name: Restore Golden Images Cache
327365
keys:
@@ -435,6 +473,7 @@ jobs:
435473

436474
visual:
437475
executor: node
476+
resource_class: xlarge
438477
parameters:
439478
system:
440479
type: string
@@ -445,7 +484,7 @@ jobs:
445484
dir:
446485
type: string
447486
steps:
448-
- downstream
487+
- setup-project
449488
- run-regressions:
450489
regression_system: << parameters.system >>
451490
regression_color: << parameters.color >>
@@ -455,11 +494,17 @@ jobs:
455494
workflows:
456495
build:
457496
jobs:
458-
- test-chromium
459-
- test-chromium-memory
460-
- test-firefox
461-
- test-webkit
497+
- lint
498+
- test-chromium:
499+
requires: [lint]
500+
- test-chromium-memory:
501+
requires: [lint]
502+
- test-firefox:
503+
requires: [lint]
504+
- test-webkit:
505+
requires: [lint]
462506
- hcm-visual:
507+
requires: [lint]
463508
filters:
464509
branches:
465510
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
@@ -470,6 +515,7 @@ workflows:
470515
# Beta docs are only published from main
471516
only: main
472517
- visual:
518+
requires: [lint]
473519
name: << matrix.system >>-<< matrix.color >>-<< matrix.scale >>-<< matrix.dir >>
474520
matrix:
475521
parameters:
@@ -482,6 +528,7 @@ workflows:
482528
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
483529
ignore: /pull\/[0-9]+/
484530
- visual:
531+
requires: [lint]
485532
name: << matrix.system >>-<< matrix.color >>-<< matrix.scale >>-<< matrix.dir >>
486533
matrix:
487534
parameters:

.github/workflows/coveralls.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: yarn playwright install --with-deps
2424

2525
- name: Run unit tests with coverage
26-
run: yarn test:ci --config web-test-runner.config.ci-chromium.js --group no-memory-ci --coverage
26+
run: yarn test:ci --config web-test-runner.config.ci-chromium.js --group unit --coverage
2727
continue-on-error: true
2828

2929
- name: Upload coverage to Coveralls

0 commit comments

Comments
 (0)