Repository navigation
test(rust): pinned anstyle replay narrows real revisions with the same failures - #258
Conversation
…blocking the repository Part of DiffCI#131. A Cargo target with required-features no longer makes every change fall back. The adapter records the target's required features, and the planner keeps that package whole (cargo test -p name, never --test name), so Cargo runs or skips the target exactly as the full cargo test does. The existing feature check gives the package the full run's features, so the gate evaluates the same way. Signed-off-by: FredApps <[email protected]>
…at owns them Part of DiffCI#131. In a Cargo-only repository, one Python generator script or C file used to make every Rust change fall back ("Mixed Rust/language repositories ..." and "Unmodeled languages alongside an adapter ..."). Both blockers are now scoped to the owning crate's directory, or the file's top-level directory outside every crate, through the existing scoped-blocker mechanism. Still repository-wide: another active adapter, JavaScript/Go/Java/... files, Python test files, files in a root package, and any workspace whose Rust code starts an external program (Command::new other than Cargo, rustc or CARGO_BIN_EXE_*, duct, xshell, cmd!). Signed-off-by: FredApps <[email protected]>
Signed-off-by: FredApps <[email protected]> # Conflicts: # docs/using-diffci.md
…ld differ Part of DiffCI#131 (dependency features / default-features = false). A workspace crate that asks for a sibling with default-features = false (servo/rust-url's url asks for percent-encoding, idna and form_urlencoded that way) made every selected command that left out the other crates refuse, so real workspaces stayed advisory. The package command now adds the tested crates of the smallest unit Cargo resolved with the full run's features, repeating until every selected crate is covered. Feature resolution is monotonic in the selected crates, so the larger command builds those packages exactly as the full run does. Without a covering unit, the plan is refused as before; integration-only and bench/example commands are checked as before. Signed-off-by: FredApps <[email protected]>
… commands Part of DiffCI#131. scripts/replay-rust.mjs takes --target glob|rust-url (glob stays the default). For a SELECTIVE plan it now runs the selected cargo test commands next to the full baseline, compares every reported test, and checks that a failing test injected into the changed file (in a separate local clone) fails both runs. Signed-off-by: FredApps <[email protected]>
Signed-off-by: FredApps <[email protected]> # Conflicts: # docs/using-diffci.md
…131-url-replay Signed-off-by: FredApps <[email protected]> # Conflicts: # docs/using-diffci.md # src/repo/adapters/rust.ts
…ing baseline with matching failures - Add rust-cli/anstyle (20 crates, committed Cargo.lock) as a pinned replay target; the harness uses a committed lockfile as is and only generates one for targets that ignore it. - Read the failed-test list libtest prints before each summary, so a test whose output shares the result line is still counted as failed. - A full baseline that fails on its own no longer fails the replay, as long as it finishes and every selected run reports exactly its failures. - The replay workflow takes a target input and gets a longer timeout. - Feature completion accepts NAME@VERSION crate names in Cargo's feature units. Signed-off-by: FredApps <[email protected]>
Signed-off-by: FredApps <[email protected]>
Its test harness interleaves output across parallel tests, and form_urlencoded does not run its unit tests, so the replay can't prove a selected run there; anstyle covers selective runs. Signed-off-by: FredApps <[email protected]>
Signed-off-by: FredApps <[email protected]>
Signed-off-by: FredApps <[email protected]>
I, FredApps <[email protected]>, hereby add my Signed-off-by to this commit: 9e06c4b Signed-off-by: FredApps <[email protected]>
|
I tried to run the replay on hosted runners from my fork, but GitHub won't start any workflow there. Its Actions settings say enabled, with all actions allowed and every workflow active, yet So the replay result here is still the local Linux run in the report (Cargo 1.100.0, anstyle pinned at |
|
Update: Actions are running on the fork again, so the replay now has a hosted run. Run 44208499759 ( |
I, FredApps <[email protected]>, hereby add my Signed-off-by to this commit: 9e06c4b Signed-off-by: FredApps <[email protected]>
…mediation commit Signed-off-by: FredApps <[email protected]>
…xed list rustSourceInputs listed the flags it ORs. DiffCI#250 (also in DiffCI#258) adds runsPrograms to rustInputs; merged after this PR, the doctests' value would have been dropped and typecheck would fail, with no textual conflict to warn about. Combining the flags by key keeps both PRs correct in either order. Signed-off-by: FredApps <[email protected]>
* fix(rust): scan doctest code in doc comments for inputs * chore: DCO remediation for 4c0e634 I, FredApps <[email protected]>, hereby add my Signed-off-by to this commit: 4c0e634 Signed-off-by: FredApps <[email protected]> * refactor(rust): combine every scan flag in rustSourceInputs, not a fixed list rustSourceInputs listed the flags it ORs. #250 (also in #258) adds runsPrograms to rustInputs; merged after this PR, the doctests' value would have been dropped and typecheck would fail, with no textual conflict to warn about. Combining the flags by key keeps both PRs correct in either order. Signed-off-by: FredApps <[email protected]> --------- Signed-off-by: FredApps <[email protected]>
Fixes #131 (this meets its done criterion: a pinned public Rust replay that narrows a historical revision, with the selected tests catching the same failures as the full baseline).
Result (report): on rust-cli/anstyle, a 20-crate workspace pinned at
46bb5c0, three of four historical revisions got a SELECTIVE plan, and two ran a narrower command than the full run:f9639e7anstyle-progress/src/query.rs1c4609aanstyle-svg/src/lib.rs4e58408anstyle-progress/src/progress.rslibcfeatures)d234fa3Cargo.lock+ svgAll four full baselines passed. No avoided-compute claim: the timings are single runs with a shared build cache.
Self-contained: includes #232, #248, #250 and #254. The replay needs all four, so this branch merges them in, with their conflicts with each other (the Rust paragraph in
docs/using-diffci.md, andrust.ts) already resolved. The diff therefore shows them too: #248 (required features), #250 (mixed-language scope), #254 (feature completion), and #232 (theNAME@VERSIONpackage-spec fix). anstyle needs #232 becauseanstreamandanstyle-parseare also published versions in its dev-dependencies, which madecargo tree -p NAMEambiguous. Commit9e06c4b(#232) was missing its sign-off; both this branch and #232 now carry a signed DCO remediation commit for it.Merge order: merge this PR instead of #232, #248, #250 and #254 (GitHub then marks those four as merged), or after them; either way needs no conflict resolution from you. #234, #252, #256 and #277 also edit the same Rust paragraph (and #234/#252 touch
rust.ts/types.ts), so whichever of those lands after this one needsmainmerged in; I will do that as each lands.What this PR itself adds:
scripts/replay-rust.mjs: a--target glob|anstyleoption with pinned targets. A target uses its committedCargo.lockas is (cargo fetch --locked), or the harness generates one when the target ignores it (glob). For a SELECTIVE plan it runs the selected commands (from the plan, or from the planner with the harness baseline as evidence), compares every reported test with the full baseline, and injects a failing test into the changed file in a separategit clone --sharedscratch copy, which both runs must catch. It reads libtest's failed-test list, so a failure whose output shares its result line is still counted. A full baseline that fails on its own no longer fails the replay, as long as the selected run reports exactly the same failures.NAME@VERSIONcrate names in Cargo's feature units, with a planner test..github/workflows/rust-replay.yml: atargetinput (glob or anstyle) and a 90-minute timeout..mdand the raw.json), listed inrelease-files.json.I also tried servo/rust-url: the plan narrowed to 4–7 of 11 test targets, but feature unification widened every command to all six crates, and its custom test harness interleaves output across parallel tests, so I left it out of the pinned targets (details in the report).
Local checks on this head: typecheck,
npm testwithDIFFCI_REQUIRE_CARGO=1(1175 pass), build,audit:boundary,agent:check. Glob still passes too.Hosted replay: run 44208499759 on the fork,
workflow_dispatchwithtarget: anstyleon head41c5343, passed onubuntu-26.04(image 20261111.196.1, Node v24.22.2, Cargo/rustc 1.99.1). The report is therust-public-replay-anstyleartifact. It matches the committed report exactly: f9639e7 ran 7/20 crates (95 of 170 tests), 1c4609a ran 6/20 (92 of 169), 4e58408 ran 18/20 (164 of 168), all with the same failures as the full baseline and the injected fault caught; d234fa3 fell back to FULL (Cargo.lock change). I also ran the same workflow on a Linux box withact(Cargo 1.100.0) and got the same numbers. The later head954c395only adds an empty merge of #232's DCO remediation commit; its tree is identical to41c5343.