Skip to content

Commit 4ffac8d

Browse files
ci: rename the parser job to spec and run CSS, HTML and XML in one leg (#22870)
1 parent 0c02242 commit 4ffac8d

5 files changed

Lines changed: 26 additions & 36 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -324,26 +324,23 @@ jobs:
324324
# One job per language, the way `runtimes` is one per runtime: each reads that
325325
# language's upstream corpus, and they differ only in which submodule they
326326
# check out and which suite they run.
327-
parser:
327+
spec:
328328
# Named for the language alone: a matrix row carries the suite and the
329329
# coverage flag too, and the generated name would otherwise print all three.
330-
name: parser (${{ matrix.language }})
330+
name: spec (${{ matrix.language }})
331331
needs: [lint, basic, unit]
332332
strategy:
333333
fail-fast: false
334334
matrix:
335335
include:
336-
- language: css
337-
submodules: test/external/css-parsing-tests
338-
script: cover:css-parsing
339-
flags: css-parsing
340-
# WPT is 161k files, so only this leg checks it out, and only one
341-
# commit deep — it carries the tree-construction corpus html5lib-tests
342-
# dropped.
343-
- language: html
344-
submodules: test/external/html5lib-tests test/external/wpt
345-
script: cover:html5lib
346-
flags: html5lib
336+
# The CSS, HTML and XML suites take a minute or two each, less than
337+
# a runner's setup, so they share one. WPT is 161k files, so it is
338+
# checked out one commit deep: it carries the tree-construction corpus
339+
# html5lib-tests dropped.
340+
- language: css-html-xml
341+
submodules: test/external/css-parsing-tests test/external/html5lib-tests test/external/wpt test/external/xml-conformance-suite
342+
script: cover:spec-css-html-xml
343+
flags: css-html-xml
347344
# Parses all of test262 with webpack's parser and with acorn and
348345
# compares the trees. Instrumented although that makes the parser ~5x
349346
# slower: about 7 min uninstrumented, well inside the job's bound.
@@ -364,12 +361,6 @@ jobs:
364361
- language: minify-fuzz
365362
script: cover:minify-fuzz
366363
flags: minify-corpora
367-
# The W3C XML Conformance Test Suite: every document is read back in
368-
# canonical form and printed, which is small enough to run covered.
369-
- language: xml
370-
submodules: test/external/xml-conformance-suite
371-
script: cover:xmlconf
372-
flags: xmlconf
373364
runs-on: ubuntu-latest
374365
# Bounded: the js leg allows ten minutes per area per mode, so a stall
375366
# would otherwise hold a runner for the 6h default.
@@ -399,10 +390,10 @@ jobs:
399390
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
400391
with:
401392
path: .jest-cache
402-
key: jest-parser-${{ matrix.language }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock', '**/jest.config.js') }}-${{ github.sha }}
393+
key: jest-spec-${{ matrix.language }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock', '**/jest.config.js') }}-${{ github.sha }}
403394
restore-keys: |
404-
jest-parser-${{ matrix.language }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock', '**/jest.config.js') }}-
405-
jest-parser-${{ matrix.language }}-${{ runner.os }}-
395+
jest-spec-${{ matrix.language }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock', '**/jest.config.js') }}-
396+
jest-spec-${{ matrix.language }}-${{ runner.os }}-
406397
407398
- run: yarn ${{ matrix.script }} --ci --cacheDirectory .jest-cache
408399

@@ -775,7 +766,7 @@ jobs:
775766
# until this runs, so they are computed once, over every suite below. A new
776767
# job uploading coverage joins `needs`, or Codecov reports before it does.
777768
coverage-notify:
778-
needs: [unit, test262, parser, syntax-equivalence, integration]
769+
needs: [unit, test262, spec, syntax-equivalence, integration]
779770
# A failed or skipped suite still gets a report from what did upload.
780771
if: ${{ !cancelled() }}
781772
runs-on: ubuntu-latest

‎TESTING_DOCS.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,14 @@ Upstream test suites webpack runs against but doesn't maintain — upstream's to
286286

287287
Git submodules, all under `test/external/`, checked out on demand: `yarn setup` doesn't fetch them, and each CI job fetches only its own, one commit deep.
288288

289-
- `test/external/test262-cases` — [tc39/test262](https://github.com/tc39/test262); fetched by `test262`, `parser (js)`, `parser (minify-corpora)`
290-
- `test/external/html5lib-tests` — [html5lib/html5lib-tests](https://github.com/html5lib/html5lib-tests); fetched by `parser (html)`
291-
- `test/external/wpt` — [web-platform-tests/wpt](https://github.com/web-platform-tests/wpt); fetched by `parser (html)`, `syntax-equivalence` (browsers)
292-
- `test/external/css-parsing-tests` — [CourtBouillon/css-parsing-tests](https://github.com/CourtBouillon/css-parsing-tests); fetched by `parser (css)`
293-
- `test/external/xml-conformance-suite` — [lddubeau/xml-conformance-suite](https://github.com/lddubeau/xml-conformance-suite) (the W3C XML Conformance Test Suite); fetched by `parser (xml)`
294-
- `test/external/terser` — [terser/terser](https://github.com/terser/terser), pinned to the installed `terser`'s version; fetched by `parser (minify-corpora)`
295-
- `test/external/swc` — [swc-project/swc](https://github.com/swc-project/swc), read only under `crates/swc_ecma_minifier/tests`; fetched by `parser (minify-corpora)`
296-
- `test/external/oxc` — [oxc-project/oxc](https://github.com/oxc-project/oxc), pinned to the installed `oxc-minify`'s release and read only under `crates/oxc_minifier/tests`; fetched by `parser (minify-corpora)`
289+
- `test/external/test262-cases` — [tc39/test262](https://github.com/tc39/test262); fetched by `test262`, `spec (js)`, `spec (minify-corpora)`
290+
- `test/external/html5lib-tests` — [html5lib/html5lib-tests](https://github.com/html5lib/html5lib-tests); fetched by `spec (css-html-xml)`
291+
- `test/external/wpt` — [web-platform-tests/wpt](https://github.com/web-platform-tests/wpt); fetched by `spec (css-html-xml)`, `syntax-equivalence` (browsers)
292+
- `test/external/css-parsing-tests` — [CourtBouillon/css-parsing-tests](https://github.com/CourtBouillon/css-parsing-tests); fetched by `spec (css-html-xml)`
293+
- `test/external/xml-conformance-suite` — [lddubeau/xml-conformance-suite](https://github.com/lddubeau/xml-conformance-suite) (the W3C XML Conformance Test Suite); fetched by `spec (css-html-xml)`
294+
- `test/external/terser` — [terser/terser](https://github.com/terser/terser), pinned to the installed `terser`'s version; fetched by `spec (minify-corpora)`
295+
- `test/external/swc` — [swc-project/swc](https://github.com/swc-project/swc), read only under `crates/swc_ecma_minifier/tests`; fetched by `spec (minify-corpora)`
296+
- `test/external/oxc` — [oxc-project/oxc](https://github.com/oxc-project/oxc), pinned to the installed `oxc-minify`'s release and read only under `crates/oxc_minifier/tests`; fetched by `spec (minify-corpora)`
297297

298298
```sh
299299
git submodule update --init --recursive --depth 1 # check out the commits the repo pins

‎codecov.yml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ coverage:
2222
flags:
2323
- unit
2424
- integration
25-
- css-parsing
26-
- html5lib
25+
- css-html-xml
2726
- test262
2827
- minify-corpora
2928
- test262-parser
30-
- xmlconf
3129
target: auto
3230
# Timing-dependent lines flip between runs, so a PR that changes no
3331
# code still moves the total by about 0.01%.

‎docs/architecture.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Every schema is derived from the module declaring its options by `generate-schem
8686
- `templates/` — suite drivers (`TestCases.js`, `ConfigTestCases.js`, `HotTestCases.js`, `WatchTestCases.js`); the top-level `*.test.js` / `*.basictest.js` / `*.longtest.js` are thin shims over them. Each exports `describeCases(config)` and resolves case directories against `test/`, never its own. The shims' option sets live together in `templates/variants.js` (re-exported as `variants`) so suite differences read side by side; there's one shim per entry because jest parallelizes per file, not per describe.
8787
- `harness/` — what runs the suites: jest lifecycle (`globalSetup.js`, `globalTeardown.js`, `setupTestFramework.js`), the `patch-node-env.js` environment, the crash reporter, the case `runner/`, the `snapshot/` resolver, and `runtimes/` (preload/setup files for Bun and Deno). Reusable assertions and fixtures go in `helpers/`.
8888
- `RoundTripConfigCases` re-bundles the output of `configCases` that have a `roundTrip.js`.
89-
- `external/` — what webpack doesn't maintain: every git submodule (today the five spec corpora below and terser's, swc's and oxc's own tests) — upstream's to change, ours only to pin. `external/wpt/` (web-platform-tests), checked out one commit deep by `parser (html)` and `syntax-equivalence`, holds the HTML tree-construction corpus since html5lib-tests dropped it.
89+
- `external/` — what webpack doesn't maintain: every git submodule (today the five spec corpora below and terser's, swc's and oxc's own tests) — upstream's to change, ours only to pin. `external/wpt/` (web-platform-tests), checked out one commit deep by `spec (css-html-xml)` and `syntax-equivalence`, holds the HTML tree-construction corpus since html5lib-tests dropped it.
9090
- `fixtures/acorn-corpus.json` — acorn's test suite, vendored rather than pinned as a submodule ([details](../TESTING_DOCS.md#external-test-corpora)).
9191

9292
**Git submodules and other external corpora** — what each is, which CI job fetches it and how to update the pins: [TESTING_DOCS.md](../TESTING_DOCS.md#external-test-corpora).

‎package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@
121121
"cover:minify": "yarn cover:base --testMatch \"<rootDir>/test/specCases/minify-corpora.spectest.js\" --coverage",
122122
"cover:minify-fuzz": "yarn cover:base --testMatch \"<rootDir>/test/specCases/js-fuzz.spectest.js\" --coverage",
123123
"cover:test262-parser": "yarn cover:base --testMatch \"<rootDir>/test/specCases/test262-parser.spectest.js\" --coverage",
124-
"cover:xmlconf": "yarn cover:base --testMatch \"<rootDir>/test/specCases/xmlconf.spectest.js\" --coverage"
124+
"cover:xmlconf": "yarn cover:base --testMatch \"<rootDir>/test/specCases/xmlconf.spectest.js\" --coverage",
125+
"cover:spec-css-html-xml": "yarn cover:base --testMatch \"<rootDir>/test/specCases/cssParsing-webpack.spectest.js\" \"<rootDir>/test/specCases/html5lib.spectest.js\" \"<rootDir>/test/specCases/xmlconf.spectest.js\" --coverage"
125126
},
126127
"lint-staged": {
127128
"*.{js,cjs,mjs}": [

0 commit comments

Comments
 (0)