Skip to content

chore: prune low-signal unit tests in favour of E2E - #40

Merged
sanchitrk merged 1 commit into
mainfrom
chore/prune-unit-tests
Sep 26, 2026
Merged

sanchitrk merged 1 commit into
mainfrom
chore/prune-unit-tests

Conversation

@sanchitrk

Copy link
Copy Markdown
Contributor

Summary

Removes unit tests that wouldn't catch a real bug the E2E suites miss, and records testing rules so new ones don't pile up again.

An isolated test was kept only if it guards something E2E can't reliably reach:

  • wire-protocol parsing and request shape against recorded provider payloads (Codex, Copilot)
  • OAuth login and refresh flows
  • billing and cost math
  • cancellation, concurrency and resource cleanup
  • data integrity (DB constraints, event-log ordering, plugin store)
  • security boundaries (sandbox escape, shell quoting, plugin containment)

Deleted: trivial helpers, schema/shape and constructor checks, tests that restate generated catalog data, mock-heavy tests that restate the implementation, and duplicates of CLI E2E coverage.

Package Before After
aikit 29 files / 490 tests 27 / 245
harness 83 / 931 66 / 500
codework 5 / 107 5 / 93
plugin 1 / 6 0 (test script removed; covered by CLI E2E)

~11k lines of test code removed.

Other changes

  • packages/codework/test/__snapshots__ is renamed to __artifacts__, and the lint ignore glob is updated to match.
  • plugin.git.live.test.ts: exchange() built a new fake LLM on every request, so each reply reused the same message id and the second insert failed with a session_entry unique-constraint error. The tests still passed because they only asserted on the first request. The fake is now created once per exchange.
  • AGENTS.md / CLAUDE.md: new Testing section — no unit tests written after the fact, E2E as the primary mechanism, a repeatable artifact under __artifacts__/ at the end of each E2E test, and failure modes written down first when isolation is unavoidable.

Coverage to be aware of

Some deleted harness tests are now covered only by the credential-gated remote E2E: Vercel live progress, Daytona buffered output, and loading a copied driver package. They only run when VERCEL_OIDC_TOKEN and DAYTONA_API_KEY are set.

Test plan

  • pnpm test in aikit, harness and codework passes
  • vp check and vp run typecheck pass
  • CODEWORK_PLUGIN_LIVE=1 plugin live suites: 12/12 pass, with the private git case run over both git+ssh and git+https
  • Remote sandbox E2E (test:sandbox:e2e) and aikit test:e2e not run in this PR (paid providers / real sandboxes)

🤖 Generated with Claude Code

Delete unit tests that would not catch a bug the E2E suites miss. Keep
isolated tests only for wire-protocol parsing, OAuth flows, billing math,
cancellation/concurrency, data integrity and security boundaries.

- aikit: 490 -> 245 tests
- harness: 931 -> 500 tests
- codework: 107 -> 93 tests
- plugin: drop the lone contract test (covered by CLI E2E) and its test script
- codework: rename test/__snapshots__ to test/__artifacts__
- harness: fix plugin.git.live reusing a fresh fake LLM per request, which
  replayed the same message id and raised a session_entry unique violation
- AGENTS.md/CLAUDE.md: add Testing rules (E2E first, __artifacts__, no
  after-the-fact unit tests)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sanchitrk
sanchitrk merged commit 9a08cc2 into main Sep 26, 2026
@sanchitrk
sanchitrk deleted the chore/prune-unit-tests branch October 8, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant