You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 05b54f1
Browse filesBrowse the repository at this point in the historyBrowse files
test(css): compare the color corpus, and group the parser jobs by language
css-parsing-tests has 8366 cases and webpack compared 13 of them — the whole
color half was run only to confirm no crash, with upstream's expected values
discarded. They are CSSOM serializations rather than minifier output, so they
cannot be compared literally; reading both the input and that serialization
through webpack's own folding and canonicalizing to `#rrggbb` does compare,
wherever both land in sRGB. That is 796 cases, and webpack agrees on all of
them — no exception list.
Where it declines to fold (lab, lch, out-of-gamut) the two spellings are not
claims about the same thing, so those stay out rather than becoming noise:
comparing every case reports 5549 differences, essentially all of them that.
The three jobs reading an upstream parser corpus become one matrix, named for
the language rather than for whose repository the fixtures live in — which had
already drifted, since `html5lib` reads WPT for the corpus html5lib-tests
dropped. They differed only in submodule, suite and coverage flag.
Copy file name to clipboardExpand all lines: AGENTS.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -202,16 +202,16 @@ The directory listings below are the canonical map of the repository. **Whenever
202
202
203
203
**Tests** — see [TESTING_DOCS.md](TESTING_DOCS.md) for directory structure, naming, and how to run a single case.
204
204
205
-
- `test/` — All test suites (`unitCases/`, `cases/`, `configCases/`, `specCases/`, `watchCases/`, `hotCases/`, `statsCases/`, `typesCases/`, `benchmarkCases/`, `memoryLimitCases/`, etc.). `templates/` holds the suite drivers (`TestCases.js`, `ConfigTestCases.js`, `HotTestCases.js`, `WatchTestCases.js`) that the `*.test.js` / `*.basictest.js` / `*.longtest.js` files at the top of `test/` are thin shims over — each exports `describeCases(config)` and resolves case directories against the `test/` root, never against its own. The option sets those shims pass live together in `templates/variants.js`, re-exported as `variants`, so what differs between the suites reads side by side rather than one file at a time — a shim exists per entry because jest parallelizes per file, not per describe. `harness/` holds what runs those suites rather than what they test — jest's own lifecycle (`globalSetup.js`, `globalTeardown.js`, `setupTestFramework.js`), the `patch-node-env.js` environment, the crash reporter, the case `runner/` and `snapshot/` resolver, and `runtimes/` for the preload and setup files that let jest run under Bun and Deno. Reusable assertions and fixtures stay in `helpers/`. `RoundTripConfigCases` re-bundles the output of `configCases` marked with a `roundTrip.js` file. `external/` holds what webpack does not maintain — every git submodule checked out for testing, today the four spec corpora below, so a directory there is upstream's to change and ours only to pin. `external/wpt/` is web-platform-tests, checked out one commit deep by the `html5lib` and `syntax-equivalence` jobs — it is where the HTML tree-construction corpus lives since html5lib-tests dropped it. acorn's own test suite is the one upstream corpus that is vendored instead of pinned, as `fixtures/acorn-corpus.json`, because acorn's npm tarball ships no tests. `unitCases/WebpackParser.unittest.js` holds both of webpack's parser entry points to it, and owns the recording of it too — no generator script and no `package.json` entry: it replays acorn's `test/tests*.js` against a driver that records each case instead of running it, and keeps the sources and options, never the expected trees, which it takes from acorn itself. Bumping the `acorn` devDependency is what moves the corpus, and the same file is what refreshes it: clone acorn at the new version into `node_modules/.cache/acorn-<version>` and re-run it with `WEBPACK_UPDATE_ACORN_CORPUS=1`. Where that checkout exists the run checks the vendored corpus against it; where it does not — CI, and every machine that never cloned — the corpus stands on the version it names, which the run pins to the installed acorn.
205
+
- `test/` — All test suites (`unitCases/`, `cases/`, `configCases/`, `specCases/`, `watchCases/`, `hotCases/`, `statsCases/`, `typesCases/`, `benchmarkCases/`, `memoryLimitCases/`, etc.). `templates/` holds the suite drivers (`TestCases.js`, `ConfigTestCases.js`, `HotTestCases.js`, `WatchTestCases.js`) that the `*.test.js` / `*.basictest.js` / `*.longtest.js` files at the top of `test/` are thin shims over — each exports `describeCases(config)` and resolves case directories against the `test/` root, never against its own. The option sets those shims pass live together in `templates/variants.js`, re-exported as `variants`, so what differs between the suites reads side by side rather than one file at a time — a shim exists per entry because jest parallelizes per file, not per describe. `harness/` holds what runs those suites rather than what they test — jest's own lifecycle (`globalSetup.js`, `globalTeardown.js`, `setupTestFramework.js`), the `patch-node-env.js` environment, the crash reporter, the case `runner/` and `snapshot/` resolver, and `runtimes/` for the preload and setup files that let jest run under Bun and Deno. Reusable assertions and fixtures stay in `helpers/`. `RoundTripConfigCases` re-bundles the output of `configCases` marked with a `roundTrip.js` file. `external/` holds what webpack does not maintain — every git submodule checked out for testing, today the four spec corpora below, so a directory there is upstream's to change and ours only to pin. `external/wpt/` is web-platform-tests, checked out one commit deep by the `parser (html)` and `syntax-equivalence` jobs — it is where the HTML tree-construction corpus lives since html5lib-tests dropped it. acorn's own test suite is the one upstream corpus that is vendored instead of pinned, as `fixtures/acorn-corpus.json`, because acorn's npm tarball ships no tests. `unitCases/WebpackParser.unittest.js` holds both of webpack's parser entry points to it, and owns the recording of it too — no generator script and no `package.json` entry: it replays acorn's `test/tests*.js` against a driver that records each case instead of running it, and keeps the sources and options, never the expected trees, which it takes from acorn itself. Bumping the `acorn` devDependency is what moves the corpus, and the same file is what refreshes it: clone acorn at the new version into `node_modules/.cache/acorn-<version>` and re-run it with `WEBPACK_UPDATE_ACORN_CORPUS=1`. Where that checkout exists the run checks the vendored corpus against it; where it does not — CI, and every machine that never cloned — the corpus stands on the version it names, which the run pins to the installed acorn.
206
206
207
207
**Git submodules** — every submodule lives under `test/external/`, checked out on demand: `yarn setup` does not fetch them, and each CI job fetches only the submodules it needs, one commit deep.
git submodule update --init --recursive --depth 1 # check out the commits the repo pins
@@ -718,7 +718,7 @@ A report that measures rather than tests — performance, memory, a preview buil
718
718
719
719
**Do not read, chase, or act on coverage until every suite that uploads it has finished.** Coverage arrives in pieces: each test suite uploads its own flag as it completes, and the service recomputes the totals after every upload. Until the last one lands the number on the PR is a partial sum — it will show a large drop, the comment will be rewritten in place several times with different percentages, and a deficit at that moment means "some suites have not reported yet", not "you lost coverage". The report itself says so, naming how many uploads the head is still missing; **read that line before reading the percentage**, and treat a non-zero count as "not ready" no matter how alarming the number next to it. **A red coverage check while coverage changed is the normal state of a healthy PR mid-run** and is not a failure to fix.
720
720
721
-
**What you are waiting for is those suites, not the whole run.** The uploading suites are the jobs that call the coverage action in `.github/workflows/test.yml` — today `unit`, `integration`, `test262`, `html5lib` and `css-parsing` (`integration` is sharded, so it alone accounts for most of the uploads, and it is gated behind `lint`, `basic` and `unit`). Read the workflow rather than this list if they have moved. Everything else on the PR — benchmarks, code scanning, dependency review, preview publishing, type-coverage, the changeset echo — never uploads a coverage report and cannot move the number, so a coverage gap is safe to fix while they are still running or even while one of them is red. Waiting on them buys nothing.
721
+
**What you are waiting for is those suites, not the whole run.** The uploading suites are the jobs that call the coverage action in `.github/workflows/test.yml` — today `unit`, `integration`, `test262` and the `parser (css)` / `parser (html)` legs (`integration` is sharded, so it alone accounts for most of the uploads, and it is gated behind `lint`, `basic` and `unit`). Read the workflow rather than this list if they have moved. Everything else on the PR — benchmarks, code scanning, dependency review, preview publishing, type-coverage, the changeset echo — never uploads a coverage report and cannot move the number, so a coverage gap is safe to fix while they are still running or even while one of them is red. Waiting on them buys nothing.
722
722
723
723
Once those suites are in, read the report; only then is a genuine patch gap worth adding a test for. Chasing an intermediate number costs a round of pointless commits and, worse, tempts changes to `lib/` that exist only to move a percentage.
0 commit comments