FN-6445: reject quality skip-list overlaps

Prevent dashboard curated skip-list entries from masking tests already covered by quality projects.

- Add validation that flags skip-list files included by quality lanes.
- Cover overlap, empty-reason overlap, and genuine orphan cases in inventory tests.
- Document that skip-lists are only for genuinely non-executed dashboard tests.

Files changed:
 docs/testing.md                                 |  1 +
 scripts/__tests__/check-test-inventory.test.mjs | 29 ++++++++++++++++++++++---
 scripts/check-test-inventory.mjs                |  9 ++++++++
 3 files changed, 36 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-6445

Fusion-Task-Lineage: 1741f684-8dfc-41fc-8f30-baa3700ac11b
This commit is contained in:
gsxdsm
2026-06-14 10:48:06 -07:00
parent c9680b5767
commit 12efd3fd3f
3 changed files with 36 additions and 3 deletions

View File

@@ -100,6 +100,17 @@ test("curated guard: fails on an unregistered (synthetic) test file", () => {
assert.ok(errors.some((e) => e.includes("synthetic-unregistered.test.ts")));
});
test("curated guard: rejects a skip-list entry that overlaps an executed quality file", () => {
const overlappingFile = "packages/dashboard/app/hooks/__tests__/useChatRooms.test.ts";
const { ok, errors } = validateDashboardCurated({
includedFiles: new Set([overlappingFile]),
allTestFiles: [overlappingFile],
skipList: [{ file: overlappingFile, reason: "pre-existing orphan FN-6442" }],
});
assert.equal(ok, false);
assert.ok(errors.some((e) => e.includes(overlappingFile) && e.includes("overlaps")));
});
test("curated guard: rejects a skip-list entry with an empty reason", () => {
const { ok, errors } = validateDashboardCurated({
includedFiles: new Set(),
@@ -110,13 +121,25 @@ test("curated guard: rejects a skip-list entry with an empty reason", () => {
assert.ok(errors.some((e) => e.includes("empty")));
});
test("curated guard: a skip-listed file does not trip the unregistered check", () => {
const { ok } = validateDashboardCurated({
test("curated guard: a skip-listed genuine orphan does not trip the overlap check", () => {
const { ok, errors } = validateDashboardCurated({
includedFiles: new Set(),
allTestFiles: ["packages/dashboard/app/b.test.ts"],
skipList: [{ file: "packages/dashboard/app/b.test.ts", reason: "pre-existing failure FN-2" }],
});
assert.equal(ok, true);
assert.equal(ok, true, errors.join("; "));
});
test("curated guard: overlapping skip-list entry still reports an empty reason", () => {
const overlappingFile = "packages/dashboard/app/hooks/__tests__/useChatRooms.test.ts";
const { ok, errors } = validateDashboardCurated({
includedFiles: new Set([overlappingFile]),
allTestFiles: [overlappingFile],
skipList: [{ file: overlappingFile, reason: " " }],
});
assert.equal(ok, false);
assert.ok(errors.some((e) => e.includes(overlappingFile) && e.includes("empty")));
assert.ok(errors.some((e) => e.includes(overlappingFile) && e.includes("overlaps")));
});
test("curated guard: a quarantined file is registered without returning to the skip-list", () => {

View File

@@ -227,6 +227,15 @@ export function validateDashboardCurated({ includedFiles, allTestFiles, skipList
if (typeof entry.reason !== "string" || entry.reason.trim().length === 0) {
errors.push(`skip-list entry for ${entry.file} has an empty "reason"`);
}
/*
FNXC:DashboardTesting 2026-06-14-10:27:
FN-6445 requires the curated skip-list to enumerate only dashboard tests no quality project executes. FN-6442 found useChatRooms.test.ts was both skip-listed and matched by the hooks/utils quality lane, which overstated the genuinely ungated orphan count; reject that overlap at validation time.
*/
if (includedFiles.has(entry.file)) {
errors.push(
`skip-list entry for ${entry.file} overlaps a file already executed by a quality project; the skip-list is for genuinely non-executed files only — remove this entry`,
);
}
skipByFile.set(entry.file, entry);
}