test: split the three oversized format-matrix specs (#651)

Vitest shards by file and runs a file's tests serially in one fork, so a single spec set the floor for the whole Integration job no matter how many shards or forks it got. Cost-aware sharding (#650) balanced the shards but could not get under that floor.

Split the three specs that exceeded it: format-matrix-comprehensive (1365s) into 4 by describe, format-matrix (1130s) into 4 with Cross-format matrix striped over FORMAT_SAMPLES, and format-matrix-generated (779s) into 3 striped over TOOLS. Largest spec is now 370s. Each preamble moved verbatim into a sibling .shared.ts exposing setupMatrixApp().

Integration shards went from 20m59s/17m55s/16m33s/9m19s to 11m44s/12m31s/10m37s/11m1s.

Coverage checked, not assumed: the set of test names collected by vitest list is byte-identical across the split, 2151 before and 2151 after. Per-shard totals matched the baseline exactly at 9903 tests, 9435 passed, 468 skipped.
This commit is contained in:
SnapOtter
2026-07-27 00:36:51 +08:00
committed by GitHub
parent d91abc8a23
commit d9978525fe
19 changed files with 3365 additions and 2947 deletions
+11 -3
View File
@@ -27,11 +27,19 @@
* Refresh by parsing per-test durations out of the Integration job logs.
*/
export const FILE_COST_SECONDS: Record<string, number> = {
"tests/integration/generated/format-matrix-comprehensive.test.ts": 1365,
"tests/integration/generated/format-matrix.test.ts": 1130,
"tests/integration/generated/format-matrix-generated.test.ts": 779,
"tests/integration/generated/format-matrix-exotic.test.ts": 370,
"tests/integration/generated/format-matrix-comprehensive-2.test.ts": 348,
"tests/integration/generated/format-matrix-comprehensive-1.test.ts": 343,
"tests/integration/generated/format-matrix-comprehensive-3.test.ts": 343,
"tests/integration/generated/format-matrix-comprehensive-4.test.ts": 343,
"tests/integration/generated/format-matrix-expanded.test.ts": 319,
"tests/integration/generated/format-matrix-1.test.ts": 309,
"tests/integration/generated/format-matrix-2.test.ts": 309,
"tests/integration/generated/format-matrix-generated-1.test.ts": 269,
"tests/integration/generated/format-matrix-generated-2.test.ts": 269,
"tests/integration/generated/format-matrix-generated-3.test.ts": 269,
"tests/integration/generated/format-matrix-3.test.ts": 267,
"tests/integration/generated/format-matrix-4.test.ts": 261,
"tests/integration/tools/image/image-enhancement.test.ts": 226,
"tests/integration/generated/new-formats.test.ts": 202,
"tests/integration/generated/format-matrix-multimodal.test.ts": 126,