test(infra): gate protected acceptance tests and ratchet test quality (TDD 2.0 Phase 1)
docs/tdd-red/07-revamp-plan.md Phase 1 — v1.1이 문서로만 선언한 것을 게이트로 옮긴다. 보호 수용 경로 게이트 (check-protected-tests.mjs): - 06 §5 의 보호 6경로를 base revision 과 비교한다. - 실패 조건: 테스트/스텝 블록 감소, expect 감소, .only 추가, skip/todo 추가, 보호 파일 삭제. - 정당한 스펙 변경은 커밋 본문 `allow-protected-change: <사유>` 또는 --reason 으로만 통과한다(사람 리뷰 대체 아님). CI quality 잡이 --base HEAD^ 로 실행하며 체크아웃이 depth 2 로 바뀐다. 얕은 클론에서는 SKIP 사유를 출력한다. 품질 래칫 (check-test-quality.mjs + test-quality-baseline.json): - 파일별 weak-assertion(toBeDefined/toBeTruthy/toBeFalsy/toBeNull)과 ambient-time(Date.now/Math.random/performance.now) 수치를 동결하고 증가만 막는다. - 128 / 203 건을 한 번에 고치지 않고 회귀만 차단한다. --update 는 리뷰 후 실행. 배선: verify:all 에 두 게이트 편입, CI quality 잡 단계 추가, map/02 §10 · tdd-red/06 §5·§6 · 07 Phase 0-1 상태 갱신. 검증: - self-test: check-protected-tests 6케이스, check-test-quality 6케이스 통과 - 실제 약화 주입 시 두 게이트가 exit 1 (smoke.spec.ts .only, 약한 단정 추가) 후 원복 - npm run test:hygiene / check:design GREEN, npm test GREEN (2800+605+31+24)
This commit is contained in:
parent
42583cc96b
commit
d3d6f34bfa
9 changed files with 658 additions and 22 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# 02 — Repository & Infrastructure Map
|
||||
|
||||
> Surface: whole repo
|
||||
> Last updated: 2026-11-04 — Wave 4 toolchain/CI map reconciliation; Windows 1.16.1 release evidence remains unchanged
|
||||
> Last updated: 2026-11-08 — TDD 2.0 Phase 0-1 gates (test metrics, protected acceptance, quality ratchet) added to CI quality
|
||||
> Source of truth for: layout, workspaces, build/test commands, CI/CD, Docker, deploy, scripts, resources
|
||||
|
||||
---
|
||||
|
|
@ -259,6 +259,11 @@ Version sync is enforced by `scripts/ci/sync-version.mjs` and `verify-release-me
|
|||
- `resources/icons/` — empty; electron-builder falls back to `build/icon.ico|png`.
|
||||
- Desktop tests: `apps/desktop/tests/` — `unit/`, `main/`, `red/`, `shared/`, `integration/`, `eval/` run under Vitest; `e2e/` holds Playwright specs plus the shared `e2e/support/electron-app.ts` fixture (per-test temp user-data dir). Artifacts in `apps/desktop/test-results/`.
|
||||
- Test taxonomy + hygiene gate: `docs/tdd-red/06-repo-application.md`. `npm run test:hygiene` (+ `:test`) rejects `.only`, reason-less `.skip()`, trivial assertions, `isVisible()`-gated assertions, machine-specific paths, `waitForTimeout`, and `.e2e.test.ts` names; wired into CI `quality`.
|
||||
- Test-system gates (TDD 2.0 Phase 0-1, 2026-11-08):
|
||||
- `npm run test:metrics` / `test:metrics:write` — suite/file/case/assertion counts plus weak-assertion and ambient-time totals; writes `docs/tdd-red/metrics/<date>.md`. Metric only, never fails.
|
||||
- `npm run check:protected-tests` (+ `:test`) — `scripts/ci/check-protected-tests.mjs` diffs the six protected acceptance specs (`06 §5`) against a base revision and fails when tests, assertions, or `.only`/`.skip` change without an `allow-protected-change:` commit marker. CI runs it against `HEAD^` (the quality job fetches depth 2).
|
||||
- `npm run test:quality` (+ `:test`, `:update`) — ratchet over `scripts/ci/test-quality-baseline.json`: per-file weak-assertion and ambient-time counts may only go down. `--update` is a reviewed action.
|
||||
- Shared file-detection helpers live in `scripts/ci/lib/test-files.mjs` so all three gates see the same test files.
|
||||
- Mobile tests: `apps/mobile-rn/__tests__/` (57 suites / 353 tests per mobile SSOT), `.maestro/` + `.maestro-output/` E2E evidence. Note: a full parallel Jest run can hit the 5s render timeout on slow machines; re-run the failing spec in isolation before treating it as a regression.
|
||||
- Web tests: `apps/web/tests/` (vitest pure-logic contracts: billing catalog, Web Push client, web STT client — now part of root `npm test`) and `apps/web/e2e/` (playwright: `smoke.spec.ts` owns the unauthenticated surface contract; billing/payple/dashboard/history are fixture-based browser journeys). Web declares its own `@playwright/test` + `vitest` devDeps (2026-11-04) instead of relying on the desktop workspace's hoisted copies.
|
||||
- API tests: `apps/api-server.Tests/` (xUnit).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue