test: Rebalance suite — unit + contract + smoke + scoverage (+ 0.6.0 bump) #377

Merged
mprihoda merged 41 commits from chore/bump-version-0.6.0 into main 2026-06-11 07:53:09 +00:00
mprihoda commented 2026-05-04 07:33:11 +00:00 (Migrated from github.com)

Summary

Single bundled PR for the end-to-end test rebalance tracked in docs/plans/2026-06-03-test-rebalance.md, shipped on top of the 0.6.0 version bump and release-asset upload that already lived on this branch.

  • Phase 0 (scoverage) — Mill modules core + dashboard instrumented with scoverage 2.1.0; baseline captured (core 77.43%, dashboard 76.24%); CI uploads per-module XML + HTML + summary.
  • Phase 1 (pilot)review-state extracted to core/model/ReviewStateCliParser with 48 munit tests; BATS slice 61 → 6 (~531× per-test speedup).
  • Phase 2 (tool contract) — new test/contract/ tier pins external-tool assumptions (git, gh, glab, scala-cli, mill, tmux) across 6 files / 35 tests; nightly + contract-labeled PRs in CI.
  • Phase 3 (bulk BATS reductions) — six clusters (3.1–3.6) slimmed: version-check, schema, dispatcher-mill-gate, doctor, infra-plugin, infra-project-cmds. ~1010s of BATS replaced by ~36s of BATS + 36 new munit tests.
  • Phase 4 (CommandEnv harness)22/22 commands migrated. Each commands/<name>.scala is now a 7-line shim delegating to iw.core.commands.<Name>.run(args, env). Capability traits introduced on-demand: Console, FileSystem, GitOps, Process, Clock, HookOps, TrackerOps (9 methods inc. forge-polymorphic create/fetch), Stdin, ServerOps, StateReader, Prompt, TmuxOps, WorktreeOps, EnvVars, ConfigOps, ServerConfigOps, DashboardLifecycle, ProcessLifecycle, ReviewStateOps. ~185 harness-test scenarios added; BATS for each command is now 1–2 round-trip smokes.
  • Phase 5 (cleanup) — CLAUDE.md testing section + docs/testing.md rewritten as end-state; #357 and #304 closed as superseded; dead is_docker() helpers stripped from prompt BATS files; IW_SERVER_DISABLED=1 audit confirmed it remains load-bearing in ServerClient.scala (4 short-circuit points) — kept in all BATS files.

Also on this branch (pre-existing)

Diff shape

  • 38 commits ahead of main.
  • Cadence: one commit per command on this branch; no force-pushes, no amends.

Test plan

  • ./mill core.test — 186/186 passing
  • ./mill dashboard.test — passing
  • Pre-commit hook (scalafmt + compile -Werror) green on every commit
  • Pre-push hook (scalafix + unit tests + 32-command compile) green
  • CI: unit + e2e + scoverage XML/HTML/summary on this PR
  • CI: contract job (nightly cron + contract label only — not gating)

Notes

Closes #357 (superseded by Phase 3 — bloop cold-start eliminated by removing dead setup work).
Closes #304 (superseded by Phase 2.7 + smoke refactor — capture-pane checks live in gated contract suite).

🤖 Generated with Claude Code

## Summary Single bundled PR for the end-to-end test rebalance tracked in [docs/plans/2026-06-03-test-rebalance.md](docs/plans/2026-06-03-test-rebalance.md), shipped on top of the 0.6.0 version bump and release-asset upload that already lived on this branch. - **Phase 0 (scoverage)** — Mill modules `core` + `dashboard` instrumented with scoverage 2.1.0; baseline captured (core 77.43%, dashboard 76.24%); CI uploads per-module XML + HTML + summary. - **Phase 1 (pilot)** — `review-state` extracted to `core/model/ReviewStateCliParser` with 48 munit tests; BATS slice 61 → 6 (~531× per-test speedup). - **Phase 2 (tool contract)** — new `test/contract/` tier pins external-tool assumptions (git, gh, glab, scala-cli, mill, tmux) across 6 files / 35 tests; nightly + `contract`-labeled PRs in CI. - **Phase 3 (bulk BATS reductions)** — six clusters (3.1–3.6) slimmed: version-check, schema, dispatcher-mill-gate, doctor, infra-plugin, infra-project-cmds. ~1010s of BATS replaced by ~36s of BATS + 36 new munit tests. - **Phase 4 (`CommandEnv` harness)** — **22/22 commands migrated**. Each `commands/<name>.scala` is now a 7-line shim delegating to `iw.core.commands.<Name>.run(args, env)`. Capability traits introduced on-demand: Console, FileSystem, GitOps, Process, Clock, HookOps, TrackerOps (9 methods inc. forge-polymorphic create/fetch), Stdin, ServerOps, StateReader, Prompt, TmuxOps, WorktreeOps, EnvVars, ConfigOps, ServerConfigOps, DashboardLifecycle, ProcessLifecycle, ReviewStateOps. ~185 harness-test scenarios added; BATS for each command is now 1–2 round-trip smokes. - **Phase 5 (cleanup)** — CLAUDE.md testing section + docs/testing.md rewritten as end-state; #357 and #304 closed as superseded; dead `is_docker()` helpers stripped from prompt BATS files; `IW_SERVER_DISABLED=1` audit confirmed it remains load-bearing in `ServerClient.scala` (4 short-circuit points) — kept in all BATS files. ## Also on this branch (pre-existing) - Bump `VERSION` to 0.6.0; tag/tarball already published at https://github.com/iterative-works/iw-cli/releases/tag/v0.6.0 (and `vlatest` already points at it). - Upload `iw-bootstrap` as a v0.6.0 release asset so the README install command works against `releases/latest/download/iw-bootstrap`. ## Diff shape - 38 commits ahead of `main`. - Cadence: one commit per command on this branch; no force-pushes, no amends. ## Test plan - [x] `./mill core.test` — 186/186 passing - [x] `./mill dashboard.test` — passing - [x] Pre-commit hook (scalafmt + compile -Werror) green on every commit - [x] Pre-push hook (scalafix + unit tests + 32-command compile) green - [ ] CI: unit + e2e + scoverage XML/HTML/summary on this PR - [ ] CI: `contract` job (nightly cron + `contract` label only — not gating) ## Notes Closes #357 (superseded by Phase 3 — bloop cold-start eliminated by removing dead setup work). Closes #304 (superseded by Phase 2.7 + smoke refactor — capture-pane checks live in gated contract suite). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.