From 7bde4e9e10b746937f7c801f183980e684a30684 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 21 Mar 2026 15:47:20 -0400 Subject: [PATCH] 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) --- .config/nextest.toml | 8 ++++++-- .github/workflows/rust.yml | 6 ++++-- AGENTS.md | 12 ++++++------ lib/crates/fabro-workflows/src/engine.rs | 6 +++++- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.config/nextest.toml b/.config/nextest.toml index 8e2235123..0141fa6ce 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -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 } diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f60cc7324..0bb72a6b8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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 diff --git a/AGENTS.md b/AGENTS.md index 58a847ad7..0938ced32 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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 diff --git a/lib/crates/fabro-workflows/src/engine.rs b/lib/crates/fabro-workflows/src/engine.rs index 9409a198b..4efb1f252 100644 --- a/lib/crates/fabro-workflows/src/engine.rs +++ b/lib/crates/fabro-workflows/src/engine.rs @@ -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");