fix(tests): 드릴 경로 시험이 선택 recipe를 지운 사본에서도 통과한다

문제: b4210753이 더한 removal-drill-test-paths 시험과 고친
feature-scaffold-drill 시험이 test:recipes가 있다고 가정한다. FE-GATE-020의
optional-recipe-removal 드릴은 recipe를 지운 사본에서 test:all을 돌고,
그 사본의 package.json에는 test:recipes가 없어 두 시험이 실패한다
(desktop merge 단계, 2d3e5889).

고른 방법: 드릴 코드(scripts/test-sample-removal.ts)처럼 사본의
package.json에 남은 suite만 「coverage 밖」으로 본다. scaffold 드릴 시험의
기대 목록에서는 test:recipes를 뺀다(그 드릴의 다른 기대처럼 사본에 늘
있는 명령만 둔다).

위험·한계: test:recipes가 없는 사본에서는 「coverage 밖 suite」 시험이
아무것도 보지 않는다. 그 사본은 그 경로 자체가 없다.

검증: desktop 묶음(w2fe-p4)의 test:optional-recipe-removal과 merge 단계.
This commit is contained in:
DongHyeonka
2026-11-12 19:51:54 +09:00
parent 2d3e58895f
commit 35b60a049a
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ describe("feature scaffold drill commands", () => {
// test:coverage (tests/unit/removal-drill-test-paths.test.ts).
expect(commands.map(({ script }) => script)).toEqual(expect.arrayContaining([
"check:types", "lint", "test:coverage", "build", "check:bundle",
"test:recipes", "check:request-fanout", "build:release-candidate",
"check:request-fanout", "build:release-candidate",
]));
for (const reason of Object.values(SCAFFOLD_DRILL_EXCLUDED_SCRIPTS)) {
expect(reason.length).toBeGreaterThan(10);
+6 -2
View File
@@ -24,6 +24,10 @@ const readConfig = (file: string) => readFileSync(file, "utf8");
const pathsOf = (entries: readonly string[]) => gatedTestPaths(scripts, entries, readConfig);
const within = (target: string, roots: readonly string[]) =>
roots.some((root) => target === root || target.startsWith(`${root}/`));
// A copy that removed the optional recipes has no test:recipes; the drill then
// runs only what the copy's package.json still has (scripts/test-sample-removal.ts).
const outsideCoverage = REMOVAL_DRILL_SUITES_OUTSIDE_COVERAGE.filter((script) =>
Object.hasOwn(scripts, script));
describe("removal drill test paths", () => {
const coverage = pathsOf(["test:coverage"]);
@@ -38,12 +42,12 @@ describe("removal drill test paths", () => {
});
it("run every test:all path in the feature removal: coverage and what it leaves out", () => {
const run = [...coverage, ...pathsOf(REMOVAL_DRILL_SUITES_OUTSIDE_COVERAGE)];
const run = [...coverage, ...pathsOf(outsideCoverage)];
expect(pathsOf(["test:all"]).filter((target) => !within(target, run))).toEqual([]);
});
it("name as outside coverage only suites coverage does not already run", () => {
for (const suite of REMOVAL_DRILL_SUITES_OUTSIDE_COVERAGE) {
for (const suite of outsideCoverage) {
expect(pathsOf([suite]).some((target) => !within(target, coverage)), suite).toBe(true);
}
});