fix(cli): a test that refused to pass vacuously failed instead - #364
Merged
Conversation
`a_run_that_was_not_contained_keeps_no_evidence_from_an_optimistic_probe` asserts that a control record carries what the RUN achieved rather than what the host probe optimistically reported. To stop that passing for the wrong reason it required the probe and the run to disagree — by asserting the probe says `Enforced`. That is only true on Linux. Everywhere else the assertion fired and the test failed outright, so `cargo test --workspace` was red before anyone had touched anything. The instinct was right; the mechanism was wrong. The disagreement is what the test needs, not which side of it this machine is on. Off Linux the probe still says "not contained" — but for a different reason — so comparing the two rendered lines keeps the test honest everywhere and green everywhere it is honest. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a CLI test that was unintentionally failing on non-Linux hosts by changing the “vacuity guard” to require only that the host probe and the run’s achieved containment tier disagree (rather than requiring the probe to report Enforced). This restores a green baseline for cargo test --workspace across macOS/Windows while keeping the test meaningful.
Changes:
- Update the test precondition to
assert_ne!(probe.report_line(), achieved.report_line()), making it host-agnostic while still preventing vacuous passes. - Add a CHANGELOG entry documenting the cross-platform test fix and why it matters for local verification gates.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/flowproof-cli/src/lib.rs | Adjusts the test’s precondition so it remains meaningful without failing outright on non-Linux hosts. |
| CHANGELOG.md | Documents the underlying problem (host-specific precondition) and the new cross-platform guard. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Small, and it makes
cargo test --workspacegreen on macOS for the first time in a while.What was wrong
a_run_that_was_not_contained_keeps_no_evidence_from_an_optimistic_probeasserts that a control record carries what the run achieved rather than what the host probe optimistically reported. That is a good thing to test.To stop it passing for the wrong reason, it required the probe and the run to disagree — by asserting the probe says
Enforced:That is true only on Linux. Everywhere else the assertion fires and the test fails outright, so
cargo test --workspaceis red on macOS and Windows before anyone has touched anything.Why it is worth fixing rather than tolerating
cargo test --workspaceis one of the three gates the Builder role requires to pass before opening a PR. A gate that is red by default is one people learn to read past — and over this session every local verification had to be checked against "is this the known failure, or mine?", which is exactly the ambiguity a green baseline removes.It is the second instance of this shape: #324 fixed the same class in the sibling test, where an assertion pinned a wording that had since changed.
The fix
The instinct was right and the mechanism was wrong. The disagreement is what the test needs, not which side of it this machine is on.
Off Linux the probe still says "not contained" — but for a different reason — so comparing the two rendered lines keeps the test meaningful everywhere:
On Linux that compares
enforced (linux seccomp)againstnot contained (the filters never installed). Off Linux it compares two different not-contained reasons. Either way the record must carry the run's, and the test still fails if it carries the probe's.No
#[ignore], no skip, no weakened assertion — the vacuity guard is kept, just expressed in a way that holds on every host.Verification
cargo test --workspaceon macOS: 57 suites, zero failures — previously one.cargo fmt --checkandcargo clippy --workspace --all-targets -- -D warningsclean.🤖 Generated with Claude Code