Add integration tests for hook skip behavior#1428
Conversation
28de9a0 to
4df3cfb
Compare
📦 Cargo Bloat ComparisonBinary size change: +0.00% (22.5 MiB → 22.5 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1428 +/- ##
=======================================
Coverage 90.74% 90.74%
=======================================
Files 82 82
Lines 16776 16776
=======================================
Hits 15224 15224
Misses 1552 1552 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f08b056 to
4be2e42
Compare
crates/prek/tests/skipped_hooks.rs
Outdated
|
|
||
| /// Skipped hooks across different priority groups (serial vs parallel). | ||
| #[test] | ||
| fn skipped_hooks_across_priority_groups() -> Result<()> { |
There was a problem hiding this comment.
I don’t get what this test is about, nothing here seems parallel to me.
There was a problem hiding this comment.
You're right. I tried to actually add parallel hook testing but it didn't go great... it was pretty difficult/flaky to test, so I abandoned it.
I updated this to just test that priority groups work properly.
|
Also consolidated two tests, and considerably simplified the regression test and made it cross-platform (removed |
4be2e42 to
aa878fa
Compare
Add integration tests verifying that prek correctly identifies and reports skipped hooks in various scenarios. Tests cover: - All hooks skipped due to no matching files - Dry run mode skipping all hooks - Mixed scenarios with both executed and skipped hooks - Skipped hooks across multiple priority groups Includes regression test for j178#1335: verifies that `git diff` is only called once (initial baseline) when all hooks skip, not once per priority group. Uses tracing output to count `get_diff` calls. Refs: j178#1327, j178#1335
aa878fa to
6364002
Compare
|
Thanks! |
Add integration tests verifying that prek correctly identifies and reports skipped hooks in various scenarios.
Tests cover:
Includes regression test for #1335: verifies that
git diffis not called to check for file modifications when all hooks in a priority group are skipped. Confirmed that test correctly fails without the fix.Refs: #1327, #1335