chore: use cargo-nextest as the test runner

- .config/nextest.toml: hang-timeout profile (warn 60s, kill 120s)
- justfile: 'just test' = cargo nextest run --workspace + cargo test --doc
- CLAUDE.md: refresh stale Status + Commands for the real workspace + nextest

163 tests run in ~7s (vs multi-minute serial cargo test).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-05 22:36:59 +02:00
parent 873efe199f
commit 7d40a2cd56
3 changed files with 27 additions and 9 deletions
+11
View File
@@ -0,0 +1,11 @@
# cargo-nextest configuration. https://nexte.st/book/configuration
#
# nextest runs each test in its own process: live per-test output, and a hard
# per-test timeout so a genuinely wedged test is killed + named rather than
# stalling the whole run.
[profile.default]
# Warn at 60s, terminate a test after 2×60s = 120s. The slowest real test is a
# couple of seconds (each #[sqlx::test] provisions its own temp DB), so this
# only ever fires on an actual hang.
slow-timeout = { period = "60s", terminate-after = 2 }
+12 -7
View File
@@ -4,19 +4,24 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Status ## Status
Freshly scaffolded Rust binary crate (edition 2024). `src/main.rs` is still the `cargo new` "Hello, world!" stub and `Cargo.toml` has no dependencies yet. There is no architecture to document — update this file as real structure emerges. Rust (edition 2024) workspace + React SPA collection-management system. Backend crates: `domain`, `db`, `api`, `auth`, `search`, `server` (axum 0.8 + sqlx/Postgres + Meilisearch). Frontend in `web/` (React 19 + Vite + pnpm). Tests need the docker-compose stack up (Postgres on **:5442**, Meilisearch on **:7700**); each `#[sqlx::test]` provisions its own temp DB.
## Commands ## Commands
```bash ```bash
cargo build # build just check # fmt + lint + test — the standard pre-commit gate
cargo run # run the binary docker compose up -d # start Postgres (:5442) + Meilisearch (:7700) for tests
cargo test # run all tests cargo build --workspace # build
cargo test <name> # run a single test by name substring cargo run -p server # run the server (or: just run — loads .env)
cargo +nightly fmt # format — always nightly, not stable cargo nextest run --workspace # run all tests — PREFERRED (per-test isolation, live output, hang timeouts)
cargo clippy # lint before committing cargo nextest run -E 'test(<name>)' # run tests matching a name substring
cargo test --workspace --doc # doctests (nextest does not run these)
cargo +nightly fmt # format — always nightly, not stable
cargo clippy --workspace --all-targets -- -D warnings # lint before committing
``` ```
(`just test` runs nextest + doctests; config in `.config/nextest.toml`.)
## Conventions ## Conventions
- **CLI args & env vars:** use `clap` with the `derive` feature. - **CLI args & env vars:** use `clap` with the `derive` feature.
+4 -2
View File
@@ -4,9 +4,11 @@ set dotenv-load
run: run:
cargo run -p server cargo run -p server
# Run the full test suite # Run the full test suite via cargo-nextest (per-test isolation, live output,
# hang timeouts). nextest does not run doctests, so they run separately.
test: test:
cargo test --workspace cargo nextest run --workspace
cargo test --workspace --doc
# Format with the nightly toolchain # Format with the nightly toolchain
fmt: fmt: