coverage-exempt.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * Heavy suites the coverage aggregate runs uninstrumented in a parallel gate.
  3. * Membership rule: a suite qualifies only when every coverage-measured
  4. * file it executes in-process (`coverage.include` spans package src trees;
  5. * typert generator src is threshold-excluded in vitest.config.ts) is already
  6. * fully covered by other suites, so removing it from the instrumented run
  7. * changes no threshold outcome. The aggregate still runs every listed suite
  8. * plain beside the instrumented gate, so correctness signal is unchanged —
  9. * only the v8 instrumentation tax on compiler- and subprocess-heavy fixtures
  10. * is dropped.
  11. */
  12. /** One coverage-exempt suite: a Vitest CLI filter and its exclude glob. */
  13. export interface CoverageExemptSuite {
  14. /** Positional file filter selecting the suite in the uninstrumented gate. */
  15. readonly filter: string
  16. /** Exclude glob removing the suite from the instrumented gate. */
  17. readonly exclude: string
  18. }
  19. /**
  20. * Set to `1` by the instrumented coverage gate; vitest.config.ts then drops
  21. * the exempt suites from every project. CLI `--exclude` cannot express this:
  22. * it does not reach per-project include resolution.
  23. */
  24. export const COVERAGE_EXEMPT_ENV = 'DSH_COVERAGE_EXEMPT_HEAVY'
  25. /** Coverage-exempt heavy suites; keep filter and exclude selecting the same files. */
  26. export const coverageExemptHeavySuites: readonly CoverageExemptSuite[] = [
  27. // Whole-workspace compiler analysis per case — the lane's longest tail.
  28. // Generator src is threshold-excluded; tools-catalog's registry and
  29. // tool-cordis imports are fully covered by those packages' own tests.
  30. {
  31. filter: 'packages/typert/generator/tests/',
  32. exclude: 'packages/typert/generator/tests/**',
  33. },
  34. // The webworker-runtime package is outside the coverage requirement by
  35. // decision: vitest.config.ts threshold-excludes its src, so every suite
  36. // runs uninstrumented. This tree includes the full-corpus import gate, a
  37. // single 900s-budget case that spawns a child sweep over every built
  38. // bundle; inside an instrumented partition it exceeds the Windows
  39. // partition budget under load.
  40. {
  41. filter: 'packages/experimental/webworker-runtime/tests/',
  42. exclude: 'packages/experimental/webworker-runtime/tests/**',
  43. },
  44. // Real child-process fixtures over scripts/ sources, which coverage never measures.
  45. { filter: 'scripts/install-lefthook.spec.ts', exclude: 'scripts/install-lefthook.spec.ts' },
  46. { filter: 'scripts/oxlint-contract.spec.ts', exclude: 'scripts/oxlint-contract.spec.ts' },
  47. { filter: 'scripts/change-scope.spec.ts', exclude: 'scripts/change-scope.spec.ts' },
  48. { filter: 'scripts/translation-pairing-merge.spec.ts', exclude: 'scripts/translation-pairing-merge.spec.ts' },
  49. // Built-artifact proof. Packer/runtime src is threshold-excluded, and the
  50. // suite self-skips on unbuilt checkouts; the serial-windows complete
  51. // reference still starts this uninstrumented gate after its build gate, so
  52. // the assertions execute against complete real artifacts there.
  53. {
  54. filter: 'packages/experimental/webworker-packer/tests/image-loadable.spec.ts',
  55. exclude: 'packages/experimental/webworker-packer/tests/image-loadable.spec.ts',
  56. },
  57. ]