0
Fork 0
mirror of https://github.com/TanStack/db.git synced 2026-11-16 06:56:43 +00:00

test(db-sqlite-persistence-core): disable the module cache for mutant runs (#2427)

The mutant harness applies a mutant while Vitest transforms persisted.ts.
Vitest 5 keeps transformed modules in node_modules/.vitest-cache, keyed by
file and config, not by the TANSTACK_DB_MUTANT environment variable. After
one run, a later run reused the cached transform, the mutant plugin never
ran, and the harness reported "not applied" for a mutant that was not tested.

Set test.fsModuleCache to false in vitest.mutants.config.ts. The option is
documented in Vitest 5 as "Cache transformed modules on the file system and
reuse them between reruns" (default true). Unmutated runs keep their cache.

Evidence:
- RED: after the first run, each later run reported "not applied" (P05,
  P06, P08, P09, P10, P18, P21, P26, P27, P28, P29, P34). The mutant
  plugin never wrote its mark.
- GREEN: scripts/demand-coverage-mutants.mjs --only=P05 run twice in a
  row, with no cache cleared by hand, applied and survived both times.
- The script already fails a mutant that is not applied, so a repeat of
  this failure is reported as BAD rather than as a survivor.

Co-authored-by: Test <test@test.com>
Co-authored-by: Isaac <no-reply@databricks.com>
This commit is contained in:
Kyle Mathews 2026-11-12 18:04:20 -07:00 • committed by GitHub
commit 21c52a07e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194