test(scaffold): 생성 드릴이 --with-create 쓰기 slice도 만들고 게이트를 돈다
문제 --with-create(NEVER)와 --with-create --keyed(KEYED)가 만드는 코드는 단위 테스트가 텍스트로만 본다. FE-GATE-020의 두 드릴(test:feature-scaffold, test:sample-removal)은 기본 기능 하나만 만들어 게이트를 돈다. 그래서 쓰기 slice의 타입·lint·테스트·빌드가 머지 게이트에서 깨져도 모른다(16 5.3절의 "생성 결과를 매번 게이트로 돌린다"는 전제). 고른 방법 - scripts/test-feature-scaffold.ts: 기본 기능(scaffold-feature) 옆에 scaffold-write-feature를 --with-create --keyed로 하나 더 만들고, 둘 다 만들어졌을 때 같은 게이트를 한 번 돈다. 바꾼 것은 WRITE_FEATURE_ID 상수, create-feature-write 검사 한 개, 게이트 조건(created && createdWrite), 머리 주석이다. - scripts/test-sample-removal.ts: 참조 기능을 지운 복사본의 create:feature 인자에 --with-create 한 개를 더했다. 쓰기 slice도 샘플에 기대지 않는다는 증거다. - 세 변형(기본, NEVER, KEYED)이 모두 드릴의 게이트를 지난다. - reference/create-feature.md의 드릴 설명을 맞췄다. 버린 대안 - 드릴 기능 하나를 --with-create로 바꾸기: 기본 변형이 게이트에서 빠진다. 위험·한계 - test:feature-scaffold는 기능 하나만큼(create:feature 한 번과 그 기능의 테스트) 길어진다. 게이트는 한 번만 돈다. - 다른 작업(게이트 담당)이 같은 두 파일의 명령 목록을 고칠 수 있다. 내 수정은 위 줄로 좁혔다. 검증 - flock 아래 CHOKIDAR_USEPOLLING=1 corepack pnpm test:feature-scaffold: rc=0, "feature scaffold: PASS (17 checks)" (생성 2 + 게이트 15), 162초. - 같은 조건 corepack pnpm test:sample-removal: rc=0, "reference-feature removal: PASS (23 checks, no fixture IDs)". 참조 기능을 지운 복사본에서 --with-create 기능을 만든 뒤 scaffold-* 게이트 9개가 모두 통과했다. 첫 실행은 tests/unit/create-feature.test.ts에 샘플 ID 문자열이 있어 fixture-id-residue로 실패했고, 그 테스트를 앞 커밋에서 고친 뒤 통과했다. Refs: docs/reviews/2026-11-03-maturity-review/09-app-core.md 09-06 Refs: docs/reviews/2026-11-03-maturity-review/16-structure-patterns.md 16-01
This commit is contained in:
@@ -14,11 +14,14 @@ import {
|
||||
/**
|
||||
* U7. A feature from `create:feature` passes the merge gates without an edit
|
||||
* and breaks no other test. A copy of the repository, sample feature
|
||||
* included, gets one generated feature and then runs the gates.
|
||||
* included, gets a default feature and a `--with-create --keyed` one, then
|
||||
* runs the gates.
|
||||
* test:sample-removal repeats the generation after deleting the sample
|
||||
* (decision 4), which proves the command needs nothing from it.
|
||||
*/
|
||||
const FEATURE_ID = "scaffold-feature";
|
||||
/** 1103/09-06. The `--with-create --keyed` slice, in its own context. */
|
||||
const WRITE_FEATURE_ID = "scaffold-write-feature";
|
||||
const REPORT = "artifacts/tests/feature-scaffold.xml";
|
||||
|
||||
const pnpmCli = requireRemovalFixtureEnvironment("npm_execpath");
|
||||
@@ -37,8 +40,13 @@ try {
|
||||
"docs",
|
||||
]);
|
||||
const created = check("create-feature", "create:feature", [FEATURE_ID]);
|
||||
const checks: RemovalCheck[] = [created];
|
||||
if (created.passed) {
|
||||
const createdWrite = check("create-feature-write", "create:feature", [
|
||||
WRITE_FEATURE_ID,
|
||||
"--with-create",
|
||||
"--keyed",
|
||||
]);
|
||||
const checks: RemovalCheck[] = [created, createdWrite];
|
||||
if (created.passed && createdWrite.passed) {
|
||||
// Commits the copy with the feature, as a project would: git-based
|
||||
// checks (git grep, git ls-files) then see the feature's files.
|
||||
sealRemovalFixtureRepository(fixtureRoot);
|
||||
|
||||
@@ -450,8 +450,11 @@ try {
|
||||
// from create:feature and runs the same gates again: the command and the
|
||||
// feature it writes need nothing from the sample.
|
||||
if (isSample) {
|
||||
// 1103/09-06. With the write slice (NEVER), which needs nothing from
|
||||
// the sample either.
|
||||
const created = check("scaffold-create-feature", "create:feature", [
|
||||
"scaffold-feature",
|
||||
"--with-create",
|
||||
]);
|
||||
checks.push(created);
|
||||
if (created.passed) {
|
||||
|
||||
Reference in New Issue
Block a user