返回 CodeWhale
nextest.toml
根目录 / .config / nextest.toml
1 # cargo-nextest profile for contributors (`cargo nextest run --workspace`).
2 #
3 # `cargo test --workspace --all-features --locked` remains the authoritative
4 # release gate. nextest is a faster local loop: it runs each test in its own
5 # process, so the 10k-test codewhale-tui unit suite finishes in well under
6 # half the wall-clock time of libtest on a multi-core machine, and slow or
7 # hanging tests are named instead of stalling the whole binary.
8 #
9 # Because tests no longer share a process, integration suites that serialize
10 # on in-process locks must be bounded here when they contend for mock-server
11 # ports or wall-clock timing budgets.
12
13 [profile.default]
14 # Name tests that take longer than this so contributors see where the time goes.
15 slow-timeout = { period = "30s" }
16 # Keep failures visible in the final summary and never retry silently:
17 # a flaky test is a bug report, not something to paper over.
18 retries = 0
19 fail-fast = false
20 final-status-level = "slow"
21 # RUST_MIN_STACK is not a nextest.toml key. CI and scripts/dev-test.sh
22 # export 16 MiB so local nextest matches the product thread stack.
23
24 [test-groups]
25 # Integration tests that spawn the real `codewhale` binary and wait on
26 # service start-up deadlines; bounded so a fully parallel run on a busy
27 # machine cannot starve them past their 30 s budgets.
28 spawns-binaries = { max-threads = 3 }
29 # Telemetry contract tests also spawn the real binary, and their fixture's
30 # in-process mutex cannot serialize nextest's one-process-per-test workers.
31 # Keep one telemetry process alongside the other three integration workers.
32 telemetry-contract = { max-threads = 1 }
33 # Persistent-service exec tests wait on a pid file from a real child. Under
34 # parallel load the file never appears (#5355). Serialize them; do not drop
35 # the tests.
36 exec-persistent-service = { max-threads = 1 }
37
38 # First matching test-group override wins. Keep these more-specific
39 # integration filters before binary(integration) so they are not stolen
40 # by the three-thread group.
41 [[profile.default.overrides]]
42 filter = 'binary(integration) & test(/^telemetry_contract::/)'
43 test-group = 'telemetry-contract'
44
45 # Same hazard, different binary. `telemetry_kill_switch_dispatch` is a
46 # codewhale-cli integration binary, not `integration`, so none of the filters
47 # below ever matched it and it ran at full parallelism beside ~15.7k tests.
48 # Each of its cases spawns the real binary, which gives a detached writer
49 # thread only CLI_PERSIST_TIMEOUT (250 ms, crates/telemetry/src/lib.rs) to
50 # re-read config from disk and fsync its batch before the process exits. Under
51 # Ubuntu CI load that deadline is missed and the dry-run receipt never lands —
52 # observed at telemetry_kill_switch_dispatch.rs:180 on PR #6104 (2026-09-12)
53 # and again on PR #6267 (2026-09-16), both Ubuntu-only, both on changes that
54 # touch neither telemetry nor the CLI.
55 [[profile.default.overrides]]
56 filter = 'binary(telemetry_kill_switch_dispatch)'
57 test-group = 'telemetry-contract'
58
59 [[profile.default.overrides]]
60 filter = 'binary(integration) & test(/^exec_persistent_service::/)'
61 test-group = 'exec-persistent-service'
62 slow-timeout = { period = "120s" }
63
64 [[profile.default.overrides]]
65 filter = 'binary(integration)'
66 test-group = 'spawns-binaries'
67
68 # CI (profiles inherit from default): the final summary lists every failure and
69 # slow test in full so the run log is enough to diagnose without rerunning.
70 [profile.ci]
71 retries = 0
72 # A test that runs past ten minutes is a hang, not a slow test: terminate it
73 # and surface its captured output instead of letting the job die at the
74 # runner's 90-minute limit with no diagnostics (v0.9.12 Windows candidate).
75 slow-timeout = { period = "60s", terminate-after = 10 }
76 fail-fast = false
77 final-status-level = "slow"
78 failure-output = "immediate-final"
79
79 lines TOML