CI: one integration-test binary per crate, ci-test profile, mold #18

Manually merged
krisbuild merged 3 commits from faster-tests into main 2026-09-27 19:50:30 +02:00
Owner

The Nix test check spent 30+ min compiling before any test ran (e.g. graph 582). Measured on ares (16 cores):

  • cargo test --release --no-run for the workspace crates: 1402 CPU-s, almost all from 27 separate integration-test binaries (~40–56 s each), each re-monomorphizing and optimizing axum/tokio/sqlite at opt-level 3.
  • The same targets in dev profile: 125 CPU-s (~11× less).

Changes:

  • kb-control-plane (19 files + common) and kb-cli (8 files) tests move to tests/it/ as modules of one binary per crate. There's no env/cwd mutation or fixed ports, so running them concurrently in one process is safe. common's blanket dead_code allow is gone because nothing is unused now.
  • New [profile.ci-test] (dev, line-tables-only debug info, deps at opt-level 2). The test check builds with it from a new test-deps derivation, which, like workspace-deps, only rebuilds when Cargo.lock changes.
  • All crane derivations link with mold (stdenvAdapters.useMoldLinker). This is Nix only: ares has no mold, so there's no .cargo/config.toml.

This is a one-off cache miss: mold changes the stdenv, so workspace-deps rebuilds once.

Verified locally: cargo clippy --workspace --all-targets -D warnings is clean, and nix build .#ci.build .#ci.clippy .#ci.test-deps passes. The full ci.test run is left to CI on this PR.

🤖 Generated with Claude Code

The Nix `test` check spent 30+ min compiling before any test ran (e.g. graph 582). Measured on ares (16 cores): - `cargo test --release --no-run` for the workspace crates: **1402 CPU-s**, almost all from 27 separate integration-test binaries (~40–56 s each), each re-monomorphizing and optimizing axum/tokio/sqlite at opt-level 3. - The same targets in dev profile: **125 CPU-s** (~11× less). Changes: - `kb-control-plane` (19 files + `common`) and `kb-cli` (8 files) tests move to `tests/it/` as modules of one binary per crate. There's no env/cwd mutation or fixed ports, so running them concurrently in one process is safe. `common`'s blanket `dead_code` allow is gone because nothing is unused now. - New `[profile.ci-test]` (dev, line-tables-only debug info, deps at opt-level 2). The `test` check builds with it from a new `test-deps` derivation, which, like `workspace-deps`, only rebuilds when Cargo.lock changes. - All crane derivations link with mold (`stdenvAdapters.useMoldLinker`). This is Nix only: ares has no mold, so there's no `.cargo/config.toml`. This is a one-off cache miss: mold changes the stdenv, so `workspace-deps` rebuilds once. Verified locally: `cargo clippy --workspace --all-targets -D warnings` is clean, and `nix build .#ci.build .#ci.clippy .#ci.test-deps` passes. The full `ci.test` run is left to CI on this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CI: one integration-test binary per crate, ci-test profile, mold
Some checks failed
krisbuild/kris/krisbuild/nix/workspace-deps cached
krisbuild/kris/krisbuild/nix/test-deps cached
krisbuild/kris/krisbuild/nix/hello cached
krisbuild/kris/krisbuild/nix/world cached
krisbuild/kris/krisbuild/nix/clippy succeeded
krisbuild/kris/krisbuild/nix/test succeeded
krisbuild/kris/krisbuild/nix/build succeeded
krisbuild/kris/krisbuild/nix/kb-check succeeded
krisbuild/kris/krisbuild krisbuild kris/krisbuild: all tasks succeeded
krisbuild/queue the pull-request head changed
4d3ba89116
The Nix test check spent 30+ minutes compiling before running a single
test: 27 separate integration-test binaries, each re-monomorphizing and
optimizing the axum/tokio/sqlite stack at opt-level 3 (~45s CPU apiece,
~1400 CPU-s total on a 16-core box).

- kb-control-plane and kb-cli tests move under tests/it/ as modules of
  a single binary each (19 + 8 binaries -> 2).
- The test check builds in a new `ci-test` profile (dev, deps at
  opt-level 2) from its own cached deps derivation; ~11x less compile
  CPU for the workspace crates than --release.
- All crane derivations link with mold.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Author
Owner
@krisbuild r+
Author
Owner

@krisbuild p=10

@krisbuild p=10
tests: fold agent_routes (from #11) into the control plane's single test binary
All checks were successful
krisbuild/kris/krisbuild/nix/test-deps cached
krisbuild/kris/krisbuild/nix/hello cached
krisbuild/kris/krisbuild/nix/workspace-deps cached
krisbuild/kris/krisbuild/nix/world cached
krisbuild/kris/krisbuild/nix/clippy succeeded
krisbuild/kris/krisbuild/nix/build succeeded
krisbuild/kris/krisbuild/nix/kb-check succeeded
krisbuild/kris/krisbuild/nix/test succeeded
krisbuild/kris/krisbuild krisbuild kris/krisbuild: all tasks succeeded
krisbuild/queue merged
921636c2e5
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator

Removed from the merge queue: the pull-request head changed.

Removed from the merge queue: the pull-request head changed.
Author
Owner

Merged main (#11 landed after this branched) and moved #11's new tests/agent_routes.rs into tests/it/: left at the top level it became its own test target whose mod common; no longer resolves, so the merge candidate would not have compiled.

@krisbuild r+ p=10

Merged main (#11 landed after this branched) and moved #11's new `tests/agent_routes.rs` into `tests/it/`: left at the top level it became its own test target whose `mod common;` no longer resolves, so the merge candidate would not have compiled. @krisbuild r+ p=10
krisbuild manually merged commit 623eac009c into main 2026-09-27 19:50:30 +02:00
Collaborator

Merged as 623eac009c.

Merged as 623eac009cb1.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
kris/krisbuild!18
No description provided.