test(gate): the coverage guard counts the perf lane's config as a gate
tests/configs/vitest.perf.config.ts (npm run test:perf) is a real gate, not a manual-only slot, so inGate() now recognizes its include list (tests/performance/** plus the four named files) directly. The 7 files already correctly listed as perf move out of MANUAL_ONLY, which is now reserved for files no automated lane covers. That alone left the guard red: tests/vfs/vfs-search-path-scope.test.ts was a genuine new orphan (added this cycle, named without the .unit.test.ts suffix its siblings use) — it ran under the broad root gate but silently missed test:unit. Renamed to match the sibling convention in tests/vfs/, which puts it back in the unit gate.
This commit is contained in:
parent
4142f36872
commit
2c5e34748e
2 changed files with 32 additions and 14 deletions
|
|
@ -4,7 +4,8 @@
|
||||||
* config (so it never runs and gives false coverage confidence — the exact drift
|
* config (so it never runs and gives false coverage confidence — the exact drift
|
||||||
* that left ~27 test files un-run before 8.0). Every `*.test.ts` must either match
|
* that left ~27 test files un-run before 8.0). Every `*.test.ts` must either match
|
||||||
* a gate config (`tests/unit/**`, `tests/integration/**`, `*.unit.test.ts`,
|
* a gate config (`tests/unit/**`, `tests/integration/**`, `*.unit.test.ts`,
|
||||||
* `*.integration.test.ts`) or be explicitly listed in MANUAL_ONLY below.
|
* `*.integration.test.ts`, or the perf lane's `tests/configs/vitest.perf.config.ts`
|
||||||
|
* — see PERF_LANE_FILES below) or be explicitly listed in MANUAL_ONLY below.
|
||||||
*/
|
*/
|
||||||
import { describe, it, expect } from 'vitest'
|
import { describe, it, expect } from 'vitest'
|
||||||
import { readdirSync } from 'node:fs'
|
import { readdirSync } from 'node:fs'
|
||||||
|
|
@ -24,10 +25,12 @@ function allTestFiles(dir: string, out: string[] = []): string[] {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test files INTENTIONALLY excluded from the unit/integration gate: benchmarks,
|
* Test files INTENTIONALLY excluded from every automated gate — conformance
|
||||||
* scale/perf measurements, package-size checks, and real-model-load checks. They
|
* suites invoked directly, and checks that need real resources (network,
|
||||||
* are run manually (slow / need real resources), not in CI. Every entry is a
|
* unusual scale) no CI lane provides. Wall-clock/scale benchmarks that DO
|
||||||
* conscious decision — a NEW orphan not listed here fails the guard below.
|
* run automatically belong to the perf lane (PERF_LANE_FILES / inGate
|
||||||
|
* below), not here. Every entry is a conscious decision — a NEW orphan not
|
||||||
|
* listed here fails the guard below.
|
||||||
*/
|
*/
|
||||||
const MANUAL_ONLY = new Set<string>([
|
const MANUAL_ONLY = new Set<string>([
|
||||||
// Conformance suites run as an explicit gate stage (both engines run them
|
// Conformance suites run as an explicit gate stage (both engines run them
|
||||||
|
|
@ -40,15 +43,11 @@ const MANUAL_ONLY = new Set<string>([
|
||||||
// The sparse-store cut's shared operator rows (both engines run these):
|
// The sparse-store cut's shared operator rows (both engines run these):
|
||||||
// explicit conformance-gate invocation, like its siblings.
|
// explicit conformance-gate invocation, like its siblings.
|
||||||
'tests/conformance/sparse-store-cut.test.ts',
|
'tests/conformance/sparse-store-cut.test.ts',
|
||||||
'tests/api/performance-benchmarks.test.ts',
|
// NOT the perf lane: no wall-clock/scale assertion, so it does not belong
|
||||||
|
// in tests/configs/vitest.perf.config.ts's include list — genuinely run
|
||||||
|
// by hand only.
|
||||||
'tests/critical-neural-validation.test.ts',
|
'tests/critical-neural-validation.test.ts',
|
||||||
'tests/critical-performance-benchmark.test.ts',
|
|
||||||
'tests/model-loading.test.ts',
|
|
||||||
'tests/package-size-breakdown.test.ts',
|
'tests/package-size-breakdown.test.ts',
|
||||||
'tests/package-size-limit.test.ts',
|
|
||||||
'tests/performance/graph-scale-performance.test.ts',
|
|
||||||
'tests/performance/triple-intelligence-scale.test.ts',
|
|
||||||
'tests/performance/typeAware.bench.test.ts',
|
|
||||||
// Cross-engine field-addressing conformance suite: pinned bit-for-bit against
|
// Cross-engine field-addressing conformance suite: pinned bit-for-bit against
|
||||||
// the native accelerator's implementation of the SAME contract, and invoked
|
// the native accelerator's implementation of the SAME contract, and invoked
|
||||||
// directly (`npx vitest run tests/conformance/namespace-law.test.ts`), never
|
// directly (`npx vitest run tests/conformance/namespace-law.test.ts`), never
|
||||||
|
|
@ -59,6 +58,21 @@ const MANUAL_ONLY = new Set<string>([
|
||||||
'tests/conformance/namespace-law.test.ts'
|
'tests/conformance/namespace-law.test.ts'
|
||||||
])
|
])
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The perf lane's own gate: `tests/configs/vitest.perf.config.ts`, run by
|
||||||
|
* `npm run test:perf`. Mirrors that config's `include` list — kept in sync
|
||||||
|
* by inspection, the same convention that config uses against the root
|
||||||
|
* gate's exclude list (see its own header comment). A file that runs here
|
||||||
|
* is GATED, not manual: it belongs in this set (or the `tests/performance/`
|
||||||
|
* prefix below), never in MANUAL_ONLY.
|
||||||
|
*/
|
||||||
|
const PERF_LANE_FILES = new Set<string>([
|
||||||
|
'tests/critical-performance-benchmark.test.ts',
|
||||||
|
'tests/api/performance-benchmarks.test.ts',
|
||||||
|
'tests/package-size-limit.test.ts',
|
||||||
|
'tests/model-loading.test.ts'
|
||||||
|
])
|
||||||
|
|
||||||
function inGate(rel: string): boolean {
|
function inGate(rel: string): boolean {
|
||||||
return (
|
return (
|
||||||
rel.startsWith('tests/unit/') ||
|
rel.startsWith('tests/unit/') ||
|
||||||
|
|
@ -67,7 +81,11 @@ function inGate(rel: string): boolean {
|
||||||
// ('tests/lifecycle/**/*.test.ts'; see tests/lifecycle/README.md).
|
// ('tests/lifecycle/**/*.test.ts'; see tests/lifecycle/README.md).
|
||||||
rel.startsWith('tests/lifecycle/') ||
|
rel.startsWith('tests/lifecycle/') ||
|
||||||
rel.endsWith('.unit.test.ts') ||
|
rel.endsWith('.unit.test.ts') ||
|
||||||
rel.endsWith('.integration.test.ts')
|
rel.endsWith('.integration.test.ts') ||
|
||||||
|
// The perf lane (see PERF_LANE_FILES above) — mirrors
|
||||||
|
// tests/configs/vitest.perf.config.ts's `tests/performance/**` glob.
|
||||||
|
rel.startsWith('tests/performance/') ||
|
||||||
|
PERF_LANE_FILES.has(rel)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @module tests/vfs/vfs-search-path-scope
|
* @module tests/vfs/vfs-search-path-scope.unit
|
||||||
* @description `vfs.search({ path })` scopes with a SERVED filter.
|
* @description `vfs.search({ path })` scopes with a SERVED filter.
|
||||||
*
|
*
|
||||||
* The scope used to be emitted as `path: { $startsWith }` — an operator that is
|
* The scope used to be emitted as `path: { $startsWith }` — an operator that is
|
||||||
Reference in a new issue