Skip to content

test(core): cover error/validation branches in ar/pattern.rs + kpm/freak/pyramid.rs (#224) - #227

Merged
kalwalt merged 3 commits into
devfrom
test/cover-error-branches-224
Jul 15, 2026
Merged

test(core): cover error/validation branches in ar/pattern.rs + kpm/freak/pyramid.rs (#224)#227
kalwalt merged 3 commits into
devfrom
test/cover-error-branches-224

Conversation

@kalwalt

@kalwalt kalwalt commented Jul 14, 2026

Copy link
Copy Markdown
Member

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.rsar_patt_activate/ar_patt_deactivate/ar_patt_free invalid-index + not-loaded paths (and happy paths); pattern_match size <= 0, buffer-too-small, unsupported-mode rejections.
  • kpm/freak/pyramid.rsPyramid::build ZeroLevels, 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.lock was gitignored, so CI re-resolved deps every run and pulled a newly-published pulp 0.22.3 that 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 via cargo update.

First item of the Stabilization & DX milestone.

🤖 Generated with Claude Code

…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

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

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>
@kalwalt kalwalt moved this from Backlog to In progress in Plan to port KPM to rust Jul 14, 2026
@kalwalt kalwalt moved this from In progress to In review in Plan to port KPM to rust Jul 14, 2026
@kalwalt
kalwalt merged commit 13988ae into dev Jul 15, 2026
22 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Plan to port KPM to rust Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant