✅ Add regression guard tests for bsdtar update @ and create -C-only#2923
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds two CLI integration tests: one ensures an Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces two new integration tests for the bsdtar compatibility layer. The first test ensures that files with a leading '@' symbol are treated as literal filesystem paths rather than archive inclusion markers during update operations. The second test verifies that the command correctly fails when directory change flags are provided without any actual file operands. Feedback was provided to improve the test assertions by checking the list of archive entries directly instead of using a HashSet, which prevents the accidental masking of duplicate entries.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cli/tests/cli/stdio/archive_inclusion.rs`:
- Around line 765-775: The test currently converts
get_archive_entry_names(&archive_path) into a HashSet (entry_names) which hides
duplicate entries and can make the "exactly 2 entries" check pass wrongly;
change the test to use the Vec returned by get_archive_entry_names directly (or
assert both Vec.len() == 2 and that
Vec.into_iter().collect::<HashSet<_>>().len() == 2) so duplicates are
detected—locate the usage of get_archive_entry_names, the entry_names binding,
and the three assertions (contains "original.txt", contains "@data.txt", and the
len check) and update them to assert cardinality against the Vec rather than the
HashSet (or add the extra dedupe-vs-raw length comparison) to prevent
regressions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 24423b4a-bdeb-40eb-8aee-c520941ec4d4
📒 Files selected for processing (2)
cli/tests/cli/stdio/archive_inclusion.rscli/tests/cli/stdio/missing_file.rs
- archive_inclusion: verify update mode treats @-prefixed operands as filesystem paths (not archive inclusion) - missing_file: verify create mode rejects -C without real input files Both tests pass on main, proving these are pre-existing correct behaviors. They guard against regressions when the -C pipeline is changed.
da46bf4 to
b158315
Compare
Summary by CodeRabbit