Configure nextest slow-timeout profiles for unit vs e2e tests

Tighten default profile to 2s slow / 4s kill for fast feedback on
hanging unit tests, and add an `e2e` profile with 10s slow / 30s kill
for ignored tests that hit real APIs. Switch CLAUDE.md/AGENTS.md and
CI to use `cargo nextest run`. Fix retry_emits_stage_started_per_attempt
test that exceeded the new timeout by using aggressive backoff preset
instead of the 5s default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-21 15:47:20 -04:00
parent e47d00a371
commit 7bde4e9e10
4 changed files with 21 additions and 11 deletions

View file

@ -1,3 +1,7 @@
[profile.default]
# Hard kill after 120s per test
slow-timeout = { period = "60s", terminate-after = 2 }
# Unit tests: flag SLOW after 2s, hard-kill after 4s
slow-timeout = { period = "2s", terminate-after = 2 }
[profile.e2e]
# E2E (ignored) tests: flag SLOW after 10s, hard-kill after 30s
slow-timeout = { period = "10s", terminate-after = 3 }

View file

@ -66,7 +66,8 @@ jobs:
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
with:
cache-on-failure: true
- run: cargo test --workspace
- uses: taiki-e/install-action@nextest
- run: cargo nextest run --workspace
test-macos:
name: Test (macOS)
@ -80,4 +81,5 @@ jobs:
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
with:
cache-on-failure: true
- run: cargo test --workspace
- uses: taiki-e/install-action@nextest
- run: cargo nextest run --workspace

View file

@ -6,11 +6,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
### Rust
- `cargo build --workspace` — build all crates
- `cargo test --workspace` — run all tests
- `cargo test -p fabro-api` — test a single crate
- `cargo test -p fabro-workflows -- test_name` — run a single test
- `set -a && source .env && set +a && cargo test --workspace -- --ignored` — run all E2E live tests (requires credentials in `.env`, see `.env.example`)
- `set -a && source .env && set +a && cargo test -p fabro-llm -- --ignored` — run E2E tests for a single crate
- `cargo nextest run --workspace` — run all unit tests
- `cargo nextest run -p fabro-api` — test a single crate
- `cargo nextest run -p fabro-workflows -- test_name` — run a single test
- `set -a && source .env && set +a && cargo nextest run --workspace --profile e2e --run-ignored only` — run all E2E live tests (requires credentials in `.env`, see `.env.example`)
- `set -a && source .env && set +a && cargo nextest run -p fabro-llm --profile e2e --run-ignored only` — run E2E tests for a single crate
- `cargo fmt --check --all` — check formatting
- `cargo clippy --workspace -- -D warnings` — lint
@ -42,7 +42,7 @@ The OpenAPI spec at `docs/api-reference/fabro-api.yaml` is the source of truth f
1. Edit `docs/api-reference/fabro-api.yaml`
2. `cargo build -p fabro-types` — build.rs regenerates Rust types via typify
3. Write/update handler in `lib/crates/fabro-api/src/server.rs`, add route to `build_router()`
4. `cargo test -p fabro-api` — conformance test catches spec/router drift
4. `cargo nextest run -p fabro-api` — conformance test catches spec/router drift
5. `cd lib/packages/fabro-api-client && bun run generate` — regenerates TypeScript Axios client
## Architecture

View file

@ -5740,9 +5740,13 @@ mod tests {
"type".to_string(),
AttrValue::String("fail_once".to_string()),
);
// Allow 1 retry → 2 attempts total
// Allow 1 retry → 2 attempts total, use aggressive backoff (500ms) for fast tests
work.attrs
.insert("max_retries".to_string(), AttrValue::Integer(1));
work.attrs.insert(
"retry_policy".to_string(),
AttrValue::String("aggressive".to_string()),
);
g.nodes.insert("work".to_string(), work);
let mut exit = Node::new("exit");