test(core): cover error/validation branches in ar/pattern.rs + kpm/freak/pyramid.rs (#224) - #227
Merged
Merged
Conversation
…eak/pyramid.rs (#224) Add unit tests for the previously-uncovered guard clauses flagged by codecov on the v0.8.0 release diff: - ar/pattern.rs: ar_patt_activate / ar_patt_deactivate / ar_patt_free invalid-index and not-loaded paths (plus the activate/deactivate/free happy paths), and pattern_match's size<=0, buffer-too-small, and unsupported-mode rejections. - kpm/freak/pyramid.rs: Pyramid::build ZeroLevels, InvalidScaleFactor, EmptyImage, and LevelTooSmall validation errors. Deterministic, no image-pipeline fixtures needed. Mirrors the edge-case approach from #177. Refs #224 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The coverage job (tarpaulin) started failing to *compile* because Cargo.lock was gitignored: CI resolved dependencies fresh on every run, and a newly published pulp 0.22.3 trips a const-eval size assertion under tarpaulin's instrumentation. All functional jobs happened to still pass, but coverage broke repo-wide (any PR). Commit the lockfile so every CI job builds the exact, known-good graph (pulp-free) instead of re-resolving. This also removes the whole class of "a transitive crate published a breaking version" CI flakes. Committing Cargo.lock does not constrain downstream crates.io consumers — Cargo ignores a dependency's lockfile. Refresh deliberately via `cargo update`. Refs #224 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Follow-up to committing Cargo.lock (#224): add a Dependency Management section explaining that the lockfile is now committed for reproducible CI, that it does not affect downstream consumers, and that updates go through a dedicated `chore(deps)` PR via `cargo update`. Refs #224 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Closes #224. Also fixes the broken coverage CI job.
1. Coverage tests (#224)
Adds unit tests for the guard clauses codecov flagged as uncovered (5 lines across two files):
ar/pattern.rs—ar_patt_activate/ar_patt_deactivate/ar_patt_freeinvalid-index + not-loaded paths (and happy paths);pattern_matchsize <= 0, buffer-too-small, unsupported-mode rejections.kpm/freak/pyramid.rs—Pyramid::buildZeroLevels,InvalidScaleFactor,EmptyImage,LevelTooSmall.All deterministic — no fixtures. Mirrors #177.
2. Commit Cargo.lock (fixes coverage CI)
The coverage (tarpaulin) job was failing to compile, unrelated to the tests:
Cargo.lockwas gitignored, so CI re-resolved deps every run and pulled a newly-publishedpulp 0.22.3that trips a const-eval assertion under tarpaulin. Committing the lockfile pins the exact (pulp-free) graph so every job builds reproducibly, and removes the recurring "a transitive crate published a breaking version" class of CI flakes. Does not affect downstream crates.io consumers (Cargo ignores a dependency's lockfile); refresh deliberately viacargo update.First item of the Stabilization & DX milestone.
🤖 Generated with Claude Code