Repository navigation
test(cli): assert the bundle-pull unmatched-pattern warning on stderr from the real binary - #2671
Merged
Merged
Conversation
… from the real binary `EntryFilter::apply_and_warn` prints unmatched `--include`/`--exclude` patterns with `eprintln!`, and the in-process unit tests only assert the message strings — dropping the call from the dry-run path left every test green. A subprocess test in `crates/cli/tests/` now runs the real `decdn get … --dry-run` against a hand-written cached v1 manifest and asserts the warning and its `**/` hint on stderr, plus the no-cache note with the filter suffix on stdout. Closes #2362 Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 3 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
… claim Dropping the `apply_and_warn` call from the dry-run path fails in-process tests, because the call also applies `land_as`; what no in-process test sees is the warning's `eprintln!`. The docs now say so and name the real offline mechanism (no chain config, so the quote stops at chain resolution). The exclude case adds a matching pattern so the plan visibly shrinks and the matched pattern gets no warning, and asserts the warning prints once. A new case covers an unmatched `--include`, which empties the plan. The cache path comes from `BundleManifest::cache_path` instead of a copied literal. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The exclude case, the one test whose plan is non-empty and so quotes, now asserts the `warning: quote unavailable` line: a quote that reaches the network fails the test instead of making it slow. The test functions take `///` docs, as most of `crates/cli/tests/` does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thiras
approved these changes
Oct 28, 2026
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.
EntryFilter::apply_and_warnprints each unmatched--include/--excludepattern witheprintln!, which no in-process test can capture: deleting that warning loop leaves every in-process test green, and the unit tests only assert the message strings. A subprocess test incrates/cli/tests/bundle_pull_dryrun.rsnow runs the realdecdn get 'decdn:<hex>/' --dry-runagainst a hand-written cached v1 manifest:--exclude, next to a matching one: the plan shrinks to the one kept entry on stdout. stderr carries exactly one warning with its**/hint, and nothing for the pattern that matched.--include: the plan empties. stderr carries the warning and hint, and stdout reports that the filters left nothing to fetch.The run stays offline: the sealed test environment has no chain config, so the quote stops at chain resolution and degrades to a
quote unavailablewarning.Notes:
-i <manifest>step is moot: the currentdecdn getsurface has no such flag.crates/e2e,anvil-e2e).Closes #2362
🤖 Generated with Claude Code