fix(test): test:all이 test:coverage가 도는 Vitest 경로를 모두 돌린다
문제 taxonomy는 test:all을 일상 개발 루프라고 적는다. 그런데 test:all은 tests/features 중 참조 샘플만(test:reference-feature) 돌리고, test:coverage(FE-GATE-005)가 도는 tests/features의 나머지(설치 표면, feature-module, 예제 기능 2파일), tests/scripts, tests/scale/browser-soak.contract.test.ts를 빠뜨린다. 로컬에서 초록이고 CI에서 빨강이 될 수 있다. 고른 방법과 버린 대안 - package.json test:all의 test:reference-feature 자리를 tests/features 전체 + tests/scripts + browser-soak 계약 테스트를 한 번에 도는 Vitest 실행으로 바꾼다. 참조 샘플 테스트도 tests/features 안이라 그대로 돈다. 샘플을 지우면 그 폴더만 빠진다. - tests/unit/test-all-paths.test.ts(새 파일): package script graph로 test:all과 test:coverage의 Vitest 경로를 모아, coverage 쪽 경로가 모두 test:all 경로 안에 있는지 본다. 다시 빠지면 이 테스트가 잡는다. - 새 package script(test:features)를 만드는 안은 버렸다. 그 이름이 tests/scripts까지 도는 것을 말하지 못하고, test:all만 쓰는 스크립트가 하나 늘 뿐이다. - taxonomy에 "CI와 같은 집합은 test:coverage"라고만 적는 안은 버렸다. 완료 기준(test:all ⊇ test:coverage의 Vitest 파일)을 못 채운다. - docs/testing/taxonomy.md의 test:all 설명을 바꾼다. 위험·한계 - 제거 드릴 셋(optional recipe, realtime, browser-file-storage)은 fixture 안에서 test:all만 돈다. 이제 이 파일들도 그 fixture에서 처음 돈다. import를 보면 제거 대상에 기대지 않지만 실행으로는 확인하지 못했다. 드릴 시간이 몇 초씩 는다(1101/10-06과 반대 방향). 검증 - desktop batch에서 확인: node scripts/run-vitest.ts run tests/unit/test-all-paths.test.ts corepack pnpm test:all, corepack pnpm check:ci, FE-GATE-020 - RED: 부모 커밋의 package.json에서 "runs every Vitest path test:coverage runs"가 tests/features·tests/scripts·browser-soak 경로를 빠졌다고 실패한다. Refs: 0929/10-05
This commit is contained in:
@@ -18,9 +18,13 @@ Each gate is blocking in its declared scope. Failures are not downgraded with
|
||||
|
||||
`test:all` is the normal product-development loop. It runs, in order,
|
||||
`test:runtime-schema`, `test:unit`, `test:contract`, `test:component`,
|
||||
`test:integration`, test:reference-feature (removed with the reference sample), `test:platform` (`tests/platform`
|
||||
`test:integration`, the rest of what `test:coverage` runs (`tests/features`,
|
||||
the reference sample's tests among them, `tests/scripts` and
|
||||
`tests/scale/browser-soak.contract.test.ts`), `test:platform` (`tests/platform`
|
||||
and `tests/architecture`), `check:release-coherence` and `test:recipes`
|
||||
(`package.json` `test:all`). It does not include `test:system`. CI-runner and
|
||||
(`package.json` `test:all`). So every Vitest path the merge gate's coverage
|
||||
run covers also runs here (`tests/unit/test-all-paths.test.ts`, 0929/10-05).
|
||||
It does not include `test:system`. CI-runner and
|
||||
supply-chain assurance has different host prerequisites and is invoked
|
||||
explicitly in the assurance path.
|
||||
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@
|
||||
"check:v8-coverage-counter-semantics": "node scripts/check-v8-coverage-counter-semantics.ts",
|
||||
"test:coverage": "corepack pnpm check:v8-coverage-counter-semantics && node scripts/run-vitest.ts run tests/runtime-schema tests/unit tests/contract tests/component tests/integration tests/features tests/platform tests/architecture tests/release tests/scripts tests/scale/browser-soak.contract.test.ts --coverage --maxWorkers=4 --reporter=default --reporter=junit --outputFile.junit=artifacts/tests/coverage.xml && node scripts/check-risk-coverage.ts",
|
||||
"check:coverage:fixture": "node scripts/check-risk-coverage.ts --summary tests/fixtures/coverage/below-threshold.json --artifact artifacts/quality/risk-coverage-fixture.json",
|
||||
"test:all": "corepack pnpm test:runtime-schema && corepack pnpm test:unit && corepack pnpm test:contract && corepack pnpm test:component && corepack pnpm test:integration && corepack pnpm test:reference-feature && corepack pnpm test:platform && corepack pnpm check:release-coherence && corepack pnpm test:recipes",
|
||||
"test:all": "corepack pnpm test:runtime-schema && corepack pnpm test:unit && corepack pnpm test:contract && corepack pnpm test:component && corepack pnpm test:integration && node scripts/run-vitest.ts run tests/features tests/scripts tests/scale/browser-soak.contract.test.ts --reporter=default && corepack pnpm test:platform && corepack pnpm check:release-coherence && corepack pnpm test:recipes",
|
||||
"verify:lockfile": "corepack pnpm install --frozen-lockfile --ignore-scripts",
|
||||
"check:frozen-lockfile:fixture": "node scripts/check-frozen-lockfile-fixture.ts",
|
||||
"generate:artifact-schemas": "node scripts/generate-product-feature-index.ts && node scripts/generate-artifact-schemas.ts",
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { gatedTestPaths } from "../../scripts/lib/ungated-tests.ts";
|
||||
|
||||
/**
|
||||
* 0929/10-05. `test:all` is the local development loop
|
||||
* (docs/testing/taxonomy.md). When it skips a Vitest path the merge gate's
|
||||
* coverage run covers, a change passes locally and fails in CI.
|
||||
*/
|
||||
const scripts = (
|
||||
JSON.parse(readFileSync("package.json", "utf8")) as {
|
||||
scripts: Record<string, string>;
|
||||
}
|
||||
).scripts;
|
||||
const readConfig = (file: string) => readFileSync(file, "utf8");
|
||||
|
||||
describe("test:all", () => {
|
||||
it("runs every Vitest path test:coverage runs", () => {
|
||||
const local = gatedTestPaths(scripts, ["test:all"], readConfig);
|
||||
const coverage = gatedTestPaths(scripts, ["test:coverage"], readConfig);
|
||||
|
||||
expect(coverage.length).toBeGreaterThan(0);
|
||||
expect(
|
||||
coverage.filter(
|
||||
(target) =>
|
||||
!local.some((path) => target === path || target.startsWith(`${path}/`)),
|
||||
),
|
||||
).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user