|
| 1 | +# Generated-App Tests Rollout Plan |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +Define the default-on rollout for generated-app tests without destabilizing existing users. |
| 6 | + |
| 7 | +## Scope |
| 8 | + |
| 9 | +This plan covers: |
| 10 | +- scaffold emission, |
| 11 | +- contract tests emission, |
| 12 | +- UI tests emission, |
| 13 | +- generated CI workflow emission, |
| 14 | +- default-on switch for emitted tests. |
| 15 | + |
| 16 | +## Current state (as of 2026-02-05) |
| 17 | + |
| 18 | +- Phase 1 complete: `--with-tests` emits test scaffold. |
| 19 | +- Phase 2 complete: contract integration test scaffold emitted. |
| 20 | +- Phase 3 complete: UI smoke test scaffold emitted (static + optional live mode). |
| 21 | +- Phase 4 complete: generated CI workflow emitted under `.github/workflows/generated-app-ci.yml`. |
| 22 | +- Phase 5 pending: default-on switch for emitted tests. |
| 23 | + |
| 24 | +## Rollout phases and defaults |
| 25 | + |
| 26 | +1. Phase 1: scaffold emission |
| 27 | +- Behavior: `th generate --with-tests` emits base `tests/` tree. |
| 28 | +- Default: OFF. |
| 29 | + |
| 30 | +2. Phase 2: contract tests emission |
| 31 | +- Behavior: emit `tests/contract/*` and add `test:contract` script. |
| 32 | +- Default: OFF. |
| 33 | + |
| 34 | +3. Phase 3: UI tests emission |
| 35 | +- Behavior: emit `tests/ui/smoke.mjs` and add `test:ui` script. |
| 36 | +- Default: OFF. |
| 37 | + |
| 38 | +4. Phase 4: generated CI template emission |
| 39 | +- Behavior: emit `.github/workflows/generated-app-ci.yml`. |
| 40 | +- Default: OFF. |
| 41 | + |
| 42 | +5. Phase 5: default-on switch |
| 43 | +- Behavior: `th generate` emits tests + generated CI workflow by default. |
| 44 | +- New opt-out flag: `--no-tests` (or equivalent) to disable emitted test scaffold. |
| 45 | +- Existing `--with-tests` remains accepted for compatibility for two minor releases after the switch, then becomes removable. |
| 46 | + |
| 47 | +## Gate for default-on switch |
| 48 | + |
| 49 | +Default-on MUST NOT be enabled until all are true: |
| 50 | + |
| 51 | +- Builder CI includes generated-app verification in `integration-local` and stays green. |
| 52 | +- At least two consecutive weeks of green `integration-local` runs on `master`. |
| 53 | +- Canonical generated app (`apps/example/job-board.schema.json`) generated-app tests pass in CI. |
| 54 | +- No open P0/P1 bugs attributed to generated test scaffolding or generated app CI template. |
| 55 | + |
| 56 | +## Compatibility strategy for existing generated apps |
| 57 | + |
| 58 | +Existing generated apps are not auto-migrated. |
| 59 | + |
| 60 | +Migration path for existing app repos: |
| 61 | +- Regenerate with `th generate --with-tests` and copy emitted `ui/tests/` + `.github/workflows/generated-app-ci.yml`. |
| 62 | +- Keep app-specific tests and custom workflows; merge generated workflow sections as needed. |
| 63 | +- Validate locally with: |
| 64 | + - `pnpm run test:contract` |
| 65 | + - `pnpm run test:ui` |
| 66 | + |
| 67 | +## Deprecation timeline for testless path |
| 68 | + |
| 69 | +- T0: Current (opt-in tests via `--with-tests`). |
| 70 | +- T1: Default-on release lands. |
| 71 | + - `--with-tests` still accepted (compat alias). |
| 72 | + - `--no-tests` documented as supported opt-out. |
| 73 | +- T2: Two minor releases after T1. |
| 74 | + - Announce pending removal of `--with-tests` alias in release notes. |
| 75 | +- T3: Four minor releases after T1. |
| 76 | + - Remove `--with-tests` alias if adoption and support metrics are stable. |
| 77 | + |
| 78 | +## Release acceptance checklist integration |
| 79 | + |
| 80 | +Before releasing default-on behavior: |
| 81 | +- `docs/release-checklist.md` generated-app tests section is complete. |
| 82 | +- PR checklist includes generated-app rollout assertions. |
| 83 | +- SPEC and AGENTS sections for generated tests are synchronized. |
0 commit comments