Repository navigation
ci(tui): run the TUI tests with cargo nextest - #31
Merged
Merged
Conversation
The vendored tests were written for cargo nextest (one process per test), and some say in a
comment that they are reliable only under it. TUI CI ran cargo test, where all tests of a
binary share one process.
- scripts/tui_baseline.toml: `[test] runner = "nextest"`; `--runner {cargo,nextest}` on the
command line takes the other one. The libtest path stays as it was.
- scripts/tui_baseline.py: `parse_nextest_output` reads the Summary line (nextest counts the
ignored tests and the tests removed by --skip together as "skipped") and the recap of the
failed tests (the live part has the captured output of a test, so it is not read);
`suite_command` builds the command line; the report names the runner; a missing
cargo-nextest stops the run at once, with a hint.
- stream(): after the timeout, SIGTERM to the process group, and SIGKILL 20 s later. nextest
puts each test in a process group of its own, so a SIGKILL to nextest left a hanging test
alive (measured on a demo crate); a nextest that gets a SIGTERM stops its tests.
- tui-ci.yml: install cargo-nextest 0.9.148 (taiki-e/install-action) in the test job; the job
is now called "cargo nextest (Linux x86_64)".
- 21 new unit tests. The fixtures are real output of nextest 0.9.148.
- Plan (status, section 10 index, revision log), execution log (new section 10.21), CHANGELOG, baselines and baseline history: the numbers of the first nextest run on the whole tree (TUI CI run 39359879537: 8,490 passed, 0 failed, 22 skipped), the test time (about 130 s with nextest, about 65 s with cargo test, same code), and the dry run of release.yml for PR #29. - Correct the r17 notes: the 7 / 4 / 3 compiles of pi-tools-api in the cargo test job were not caused by the protoc path (PR #30 shows it), and the runner never ran doctests, so nextest loses nothing there. - Remove a duplicated "verification" heading from the r17 text.
zy1233
added a commit
that referenced
this pull request
Oct 25, 2026
…to #31 (plan r19) (#33) The owner asked for three things: merge the five open PRs (#27 to #31) into main with `gh stack`, set the V0.6 milestone from the present state, and pause development for 1 to 2 days. The merge is done (stack #32, `gh stack merge 32 --yes --squash`). main goes from 7d82c27 to b33017a with five squash commits. The tree of each commit is the tree of its PR head. CI and TUI CI pass on b33017a (8,490 passed, 0 failed, 22 skipped). The plan gets a new section "发布里程碑 V0.6": the scope (the 10 commits on main after v0.5.0), six exit conditions with their state, the known issues (two are new), and what is not in V0.6. It also gets the r19 status, the pause, and the fixed status of the places that still said "waiting for merge" for #25 to #28. The execution log gets section 10.22: the install of `gh stack` (the first download was cut short), the merge, the check of the trees, CI on main, the milestone, the pause, and what is not verified. The GitHub milestone v0.6.0 (#2) is created. It has no due date and no PRs, as v0.5.0. No condition is met yet. Only documents change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plan item
nextest_ci, chosen by the owner on 2026-10-20:TUI CIand the baseline runner run the Rust tests withcargo nextest(one process for each test), not withcargo test(all tests of a suite as threads of one process, 4 threads, fixed order).Why: the vendored tests were written for nextest. Their comments say so (
pi-shell/src/config/tests.rs:2515,pi-pager-render/src/terminal/xtversion.rs:210,pi-workspace/src/lib.rs:78,pi-telemetry/src/debug_log.rs:528). Undercargo testthey share the environment variables and everystatic, and #28 had to find the resulting races one by one. Under nextest, this class of failure cannot occur, also for tests that someone writes later.Base:
fix/tui-protoc-absolute-path(#30), the same chain as #27 to #29. Not merged. #27, #28, #29 and #30 are not merged either.Three things to know:
#[ignore]tests and the tests that a--skipfilter removes together as skipped. The expected number is 22 (21 ignored + 1--skipfilter ofpi-acp-libin the manifest), wherecargo testprinted 21 ignored. The runner and the report say "skipped" for nextest.--lib,--testand--bintargets.[email protected](taiki-e/install-action, which checks the checksums of the download). Change the pin together with the parser and its tests.Evidence
cargo test;pi-pagerlib alone: 29.7 s (WSL2, 4 threads).After:
cargo nextest; the same suite: 79.5 s (nextest starts one process for each test). The CI time comes below with the other numbers.scripts/tests/test_tui_baseline.py): Windows 50 passed / 3 skipped (the 3 POSIX-only stream tests), Linux (WSL2) 53 passed. The fixture of the parser is real output of nextest 0.9.148 for a run with failures.known_failures, a machine without nextest (stops with the install hint), and a test that hangs (see the next point).TUI CIrun 39359879537,1a49eef): 8,490 passed, 0 failed, 22 skipped, as expected. Every suite equals itsreference_passed:pi-shell838,pi-pager5,651,pi-pager-render1,092,pi-pager-minimal79,pi-pager-bin21,pi-acp-lib21,pi-http13,pi-telemetry239,pi-file-utils216,pi-sampling-types320. The log has 8,490PASSlines and noSLOW,LEAK,FLAKYorTIMEOUTline. The 14 tests ofpython_agent_e2eran and passed (PI_E2E_REQUIRED=1). The gates did not change: dependency graph 970, 0 warnings,leader243,x.ai297, 0 errors incargo check --workspace --tests.CIrun 39359879347 passed too (Ruff 9 s;pytest3.11, 3.12 and 3.13 took about 2 min 18 s each).Summarytimes of the suites, added up;pi-pager85.2 s) and about 64.5 s withcargo test(same code: run 39359526868 of fix(tui): give cargo the absolute path of protoc, so it stops rebuilding pi-tools-api #30,e2de4c4). That is +66 s, of which 48 s are inpi-pager. The whole job took 36 min 17 s, against 33 min 56 s for thecargo testjob that started 4 minutes earlier. The total time of the job changes much from run to run (17 min 34 s to 33 min 56 s in the last 7 runs ofcargo test: compile and cache differ), so compare the 66 s of test time, not the total.TUI CIrun 39364431757 (the docs commit464d8c9; the code is the same) passed with the same counts (8,490 passed / 0 failed / 22 skipped), tests of about 125 s (pi-pager82.5 s) and a job time of 23 min 12 s. The difference to the first run is the cache of the build (Swatinem/rust-cache; only runs onmainsave it): the first run restored nothing (the cache step took 1 s; theTest suitesstep took 35 min 22 s), the second restored a cache (74 s;Test suites21 min 07 s). Thecargo testruns show the same: without cachee2de4c4(0 s;Test suites33 min 06 s), with cache7a4ce9d(65 s;Test suites20 min 16 s). So with a cache, the step takes 21 min 07 s with nextest and 20 min 16 s withcargo test: about 1 min more. The older runs of this tree with a cache (59 s to 108 s) took 12 to 23 min.464d8c9(docs only; the code is the same as in the run above) also corrects two claims of r17 in the plan and the execution log: the 7 / 4 / 3 compiles ofpi-tools-apiin thecargo testjob were not caused by theprotocpath (see fix(tui): give cargo the absolute path of protoc, so it stops rebuilding pi-tools-api #30), and the runner never ran doctests. It removes a duplicated heading from the r17 text of test(tui): fix the tests that share process-wide state and fail at random (plan decision 10) #28, and it records the dry run ofrelease.ymlfor ci(release): pass repo-token to setup-protoc in the release workflow #29 (it passed). A docs-only push startsTUI CIagain; the code did not change.Merge Danger
Door: two-way. Revert the commit, or set
runner = "cargo"in the manifest.Blast Radius: the
testjob ofTUI CIand the local baseline runner. The job is now namedcargo nextest (Linux x86_64). The ruleset onmainhas no required status check (onlydeletionandnon_fast_forward), so the new name blocks nothing; older docs keep the old name as history. A new third-party action (taiki-e/install-action@v2) runs in the job, asarduino/setup-protocandSwatinem/rust-cachedo already. If one of these tests needs the shared process, it fails in this PR's run, not after the merge. The vendored comments name none; onlypi-fast-worktreesays that its tests must pass under both runners, and the baseline does not run that package (its tests do not compile).