Repository navigation
feat: per-package file allow-lists for cargo soothfast test - #260
Merged
Merged
Conversation
- A root package owns every file outside the members, so a deny-list goes stale with each new root file and re-runs every root test - A file its package's list leaves out is ignored, after inputs, ignore and build-wide files, which keep their precedence
- A member's Cargo.toml is not a build-wide file, so a list without it hid dependency and feature changes and served a stale pass
Contributor
soothfast gate: soothfast-measure |
Contributor
soothfast gate: soothfast-docs |
Contributor
soothfast gate: soothfast-registry |
Contributor
soothfast gate: soothfast-report |
Contributor
soothfast gate: soothfast-site |
Contributor
soothfast gate: soothfast-sdk |
Contributor
soothfast gate: soothfast-spec |
This branch was successfully deployed
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.
What changed
A package at the workspace root owns every file outside the member crates, so keeping
cargo soothfast testfrom re-running it meant anignoreentry for every directory no test reads. Any new root file selected the package and invalidated its stored passes until someone added another entry.soothfast.tomlcan now say which files a package's tests depend on instead, and everything else the package owns stops counting.[test.packages.NAME]tables with afileslist of globs relative to the package's manifest directory. A file the package owns that matches none of them is ignored for selection and left out of the package's key.inputsstill wins over a list,ignorestill subtracts from it, and the build-wide files (Cargo.toml,Cargo.lock, the toolchain and cargo config) still select every package.Cargo.tomlfor it whatever its list says. A member's manifest is not a build-wide file, so leaving it out would have hidden dependency and feature changes.files, a repeated table, an unknown key, an unbalanced quote in the name, and any other[test.*]table.docs/testing.md. That includes what to list (the generatedtests/soothfast_docs/andexamples/soothfast_capture/targets among them), that the list is about what tests read rather than whatcargo packageships, and that reads by relative path outside the package are invisible to it.Why
A deny-list goes stale every time a file is added at the root. An allow-list only changes when the tests start reading something new.
How was this tested
select::classify, fromselect()and frompackage_inputsandworkspace_inputsintest/key.rs.inputs,ignoreand the build-wide files keep their precedence;Cargo.tomlstill counts.[test.packages."..."]table to the site config test that checks foreign tables are skipped.cargo test -p cargo-soothfast --bin cargo-soothfast -- test::config test::select test::key: 43 passed.cargo test -p soothfast-site config: 10 passed.cargo soothfast docs build: 20 pages built, so the site renderer accepts the new section.make check: passed (test: 2 of 10 packages selected, 4 binaries run, 0 skipped (cached), doc tests in 1 packages), at the commit before the manifest fix. The manifest fix was covered by the scoped tests above and the pre-commit hook's fmt and clippy.make gate BASE=masterwas not run. This changes no measured code.Checklist
make checkpasses (fmt, clippy-D warnings,cargo test --workspace)make gate BASE=masterpasses, or any intentional cost change is explained above///doc commentsREADME.md,docs/,soothfast:bind/soothfast:claimmarkers) updated if behavior changed