Commit b31e822
committed
Fix mutation testing pipeline and tighten threshold to 70
Stryker's default plugins glob "@stryker-mutator/*" resolves a directory
relative to core's own install path. Under pnpm's isolated layout that
landed in .pnpm/@stryker-mutator+core.../node_modules/@stryker-mutator/,
which only contains core/api/util/instrumenter (all on Stryker's
IGNORED_PACKAGES list). Sibling plugins live in different .pnpm/* paths,
so the glob found nothing and every run died at "Cannot find Checker
plugin typescript". List the two plugins explicitly so they go through
normal import() resolution and resolve via root node_modules symlinks.
Point tsconfigFile at server/tsconfig.json instead of tsconfig.base.json:
the base is an options-only file with no include, so tsc fell back to
**/*.ts from cwd and hit genuine type errors in client/test/ (which
typecheck under client/tsconfig.json's lib: ["DOM"]).
Drop transpilers/*/src from mutate. The real transpiler tests are
shell scripts (server/test/{td,tbaf}/test.sh) that invoke the built
fgtp CLI and diff against expected files; they are not vitest tests and
Stryker's vitest-runner cannot see them. The transpilers' in-vitest
suite covers <15% of the surface (transpilers/vitest.config.ts floor),
so mutating those files against the vitest suite would have produced a
floor-near-0 score regardless of how the pipeline was tuned.
Add server/vitest.mutation.config.ts as the Stryker test config. It
extends server/vitest.config.ts but excludes tests that read from
external/ (rename.test.ts, call-sites.test.ts, weidu-tp2/format.test.ts)
because Stryker's sandbox does not have those fixtures: external/ is
ignored via ignorePatterns since it contains cloned mod repos with
broken symlinks that crash the sandbox copy walker. Coverage is disabled
since Stryker has its own perTest coverage analysis.
Whitelist the new vitest config in knip.ts: knip's Stryker plugin
resolves runner and checker package names from stryker.conf.json but
not the vitest configFile path.
With the pipeline working, baseline mutation score on master is 70.09%:
- normalized-uri.ts: 100% (5/5 mutants killed)
- provider-registry.ts: 84.31% (43 killed, 4 survived, 4 no-coverage)
- symbol-index.ts: 65.17% (116 killed, 40 survived, 22 no-coverage)
Raise break and low from 60 to 70 to floor-and-ratchet at today's score.1 parent 70550d8 commit b31e822
3 files changed
Lines changed: 45 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | | - | |
7 | | - | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | | - | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | | - | |
18 | | - | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
0 commit comments