~396 integration-test binaries (149 GB target/): consolidate into harness binaries per crate, then audit the registries #530

Closed
opened 2026-11-09 08:03:49 +01:00 by buildagent · 1 comment
Member

Consolidated scope (triage 2026-11-09)

Priority: Medium: target/ is 149 GB; link time and disk on every gate run.


Original report

Summary

Integration tests are spread over ~396 separate test binaries: tests/*.rs counts are indexer 163, daemon 100, mcp-server 92, cli 41. Only sdk-tests, guest-kit and guest set autotests = false. Every file links the whole crate graph into its own executable.

This is a likely large contributor to:

  • the ~50 GB target/ per worktree recorded in the operator notes. The primary target/ is 149 GB today (du -sh target, 2026-11-09).
  • link time on every full gate run and in CI.

Test code totals about 397k lines against 335k lines of source. 94 gate/registry/parity/contract/disclosure files make up 94k lines, of which 33 *registry* files are 39k.

Proposal

  1. Mechanical first: per crate, set autotests = false and add one or a few harness binaries (tests/main.rs with mod <suite>; per former file, possibly split by "fast" and "corpus/slow"). There is no semantic change, and test names keep their module path.
    • Watch-outs: tests that rely on per-binary process state (env vars, set_current_dir, global loggers, panic hooks) must be found first. nextest's process-per-test model keeps isolation if CI uses it.
    • The corpus and gate commands in CLAUDE.md name --test <binary>, so update those commands and ci.yml in the same PR.
  2. Then audit: for each *registry* test, record which defect it caught last, or which mutation it kills, and merge registries that check the same axis into table-driven tests.

Acceptance

  • Measure before and after: target/ size after a full cargo test --workspace --no-run, wall-clock for the CLAUDE.md gate set, and CI duration.
  • Same test count, all green, baseline.json unchanged.

Found by an automated bloat review (2026-11-09). Counts verified by hand; the disk and link-time benefit is plausible but not measured yet.


Filed from a five-agent review of master @ e3ec6ead (bloat, robustness, agent usefulness, docs, architecture). Every finding was spot-checked in the main session before filing.

## Consolidated scope (triage 2026-11-09) **Priority: Medium**: target/ is 149 GB; link time and disk on every gate run. --- ## Original report ## Summary Integration tests are spread over **~396 separate test binaries**: `tests/*.rs` counts are indexer 163, daemon 100, mcp-server 92, cli 41. Only `sdk-tests`, `guest-kit` and `guest` set `autotests = false`. Every file links the whole crate graph into its own executable. This is a likely large contributor to: - the **~50 GB `target/` per worktree** recorded in the operator notes. The primary `target/` is **149 GB** today (`du -sh target`, 2026-11-09). - link time on every full gate run and in CI. Test code totals about 397k lines against 335k lines of source. 94 gate/registry/parity/contract/disclosure files make up 94k lines, of which 33 `*registry*` files are 39k. ## Proposal 1. **Mechanical first:** per crate, set `autotests = false` and add one or a few harness binaries (`tests/main.rs` with `mod <suite>;` per former file, possibly split by "fast" and "corpus/slow"). There is no semantic change, and test names keep their module path. - Watch-outs: tests that rely on per-binary process state (env vars, `set_current_dir`, global loggers, panic hooks) must be found first. nextest's process-per-test model keeps isolation if CI uses it. - The corpus and gate commands in CLAUDE.md name `--test <binary>`, so update those commands and `ci.yml` in the same PR. 2. **Then audit:** for each `*registry*` test, record which defect it caught last, or which mutation it kills, and merge registries that check the same axis into table-driven tests. ## Acceptance - Measure **before and after**: `target/` size after a full `cargo test --workspace --no-run`, wall-clock for the CLAUDE.md gate set, and CI duration. - Same test count, all green, `baseline.json` unchanged. Found by an automated bloat review (2026-11-09). Counts verified by hand; the disk and link-time benefit is plausible but **not measured yet**. --- _Filed from a five-agent review of master @ e3ec6ead (bloat, robustness, agent usefulness, docs, architecture). Every finding was spot-checked in the main session before filing._
Author
Member

Merged into #42.
Explicit guest/guest-kit/sdk-test harnesses exist; the requested indexer/daemon/MCP/CLI consolidation is not delivered.
Remaining: Test binaries and isolation, including usefulness audit and before/after measurements.

Merged into #42. Explicit guest/guest-kit/sdk-test harnesses exist; the requested indexer/daemon/MCP/CLI consolidation is not delivered. Remaining: Test binaries and isolation, including usefulness audit and before/after measurements.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#530
No description provided.