Skip to content

test(cli): assert the bundle-pull unmatched-pattern warning on stderr from the real binary - #2671

Merged
thiras merged 3 commits into
mainfrom
fix/2362-bundle-warn-stderr-test
Oct 28, 2026
Merged

thiras merged 3 commits into
mainfrom
fix/2362-bundle-warn-stderr-test

Conversation

@yigitdot

@yigitdot yigitdot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

EntryFilter::apply_and_warn prints each unmatched --include/--exclude pattern with eprintln!, 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 in crates/cli/tests/bundle_pull_dryrun.rs now runs the real decdn get 'decdn:<hex>/' --dry-run against a hand-written cached v1 manifest:

  • Unmatched --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.
  • Unmatched --include: the plan empties. stderr carries the warning and hint, and stdout reports that the filters left nothing to fetch.
  • No cached manifest: stdout carries the no-cache note with the filter suffix, and stderr carries no unmatched-pattern warning.

The run stays offline: the sealed test environment has no chain config, so the quote stops at chain resolution and degrades to a quote unavailable warning.

Notes:

Closes #2362

🤖 Generated with Claude Code

… 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]>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 03:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-code-quality

github-code-quality Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: Rust

Rust / code-coverage/cargo-llvm-cov

main 0273aad fix/2362-bundle-warn... 5fb8ff9 +/-
77% 77% 0%
View coverage of the 3 most impacted files.
File main 0273aad fix/2362-bundle-warn... 5fb8ff9 +/-
crates/cli/src/...mmands/quote.rs 71% 71% 0%
crates/cli/src/commands/get.rs 93% 94% +1%
crates/cli/src/.../bundle_pull.rs 55% 57% +2%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 28, 2026 04:24 UTC

… 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]>
@yigitdot
yigitdot requested a review from thiras October 28, 2026 04:24
@thiras
thiras merged commit ce241f3 into main Oct 28, 2026
37 checks passed
@thiras
thiras deleted the fix/2362-bundle-warn-stderr-test branch October 28, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(cli): assert the bundle pull unmatched-pattern warning on stderr from the real binary

3 participants