From 35b60a049a0d9d73f236a6a8a6b9fe401ac4c669 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 19:51:54 +0900 Subject: [PATCH] =?UTF-8?q?fix(tests):=20=EB=93=9C=EB=A6=B4=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EC=8B=9C=ED=97=98=EC=9D=B4=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?recipe=EB=A5=BC=20=EC=A7=80=EC=9A=B4=20=EC=82=AC=EB=B3=B8?= =?UTF-8?q?=EC=97=90=EC=84=9C=EB=8F=84=20=ED=86=B5=EA=B3=BC=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: 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 단계. --- tests/unit/feature-scaffold-drill.test.ts | 2 +- tests/unit/removal-drill-test-paths.test.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/unit/feature-scaffold-drill.test.ts b/tests/unit/feature-scaffold-drill.test.ts index 2037ea13..956dd2b5 100644 --- a/tests/unit/feature-scaffold-drill.test.ts +++ b/tests/unit/feature-scaffold-drill.test.ts @@ -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); diff --git a/tests/unit/removal-drill-test-paths.test.ts b/tests/unit/removal-drill-test-paths.test.ts index 8b3f5188..c10f14be 100644 --- a/tests/unit/removal-drill-test-paths.test.ts +++ b/tests/unit/removal-drill-test-paths.test.ts @@ -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); } });