Skip to content

🧪 test(coverage): remove three lines no run can execute - #2202

Merged
gaborbernat merged 2 commits into
mainfrom
fix/uncoverable-test-lines-2198
Sep 8, 2026
Merged

🧪 test(coverage): remove three lines no run can execute#2202
gaborbernat merged 2 commits into
mainfrom
fix/uncoverable-test-lines-2198

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Sep 8, 2026

Copy link
Copy Markdown
Member

main has failed its own coverage gate since #2178, so nothing can merge. #2192, #2187 and #2162 all report the same seven lines, and no diff among them touches one. This removes those lines.

git log -S on each of the three sites returns one commit, d75b16a12, which is #2178. None of them existed before it, so nothing earlier can have exposed or masked them, and no merge artefact is needed to explain the timing. The earlier failure at 0df149bfc was a different fault in the same job, a panic that reported no uncovered lines at all, and it is filed as #2200.

Two of the lines are validate_retention on the retention doubles #2178 added. The trait requires the method, so neither body can go away, and a default returning Ok(()) on a validation hook would beat the dead line only by hiding a driver that forgot to validate. What the two doubles can do is what the file's three older doubles do: validate the policy they were handed as the first act of plan_retention. #2178 added two that skip that step, leaving a method every driver must implement with no caller anywhere. Restoring the step gives it the same caller the others have, and the gated double keeps asserting exactly what it did.

The panicking double needed a different answer, which CI caught rather than my reasoning. Validating before the panic moved the dead line instead of removing it: a panic! never completes, so its region never records, and the entry region that had been covering that line moved up to the validation. Seven uncovered lines became one. That double now comes apart inside validate_retention, with plan_retention as the call that asks for it, so both required methods sit on the path the test drives and each is a single statement its entry region covers. The worker still dies inside the plan, which is what the test asserts.

The third is a straight deletion. published.is_ok() sat in an assert_eq! failure message, which evaluates only when the assertion trips, and the line above it already asked the same Result whether the publish failed. Binding the answer once before the comparison removes the unreachable evaluation and the second pass over the Result together.

Measured rather than reasoned. cargo llvm-cov nextest -p peryx-driver -p peryx-ecosystem-oci now reports neither tests/unit/retention/tests.rs nor tests/unit/quota/tests.rs in its uncovered list, and 1908 tests pass across the two crates.

Closes #2199

main has failed its own coverage gate since #2178, so nothing can merge. The
three lines it names arrived with that PR and no input reaches any of them.

Two are validate_retention on the retention doubles it added. The file's three
older doubles each validate the policy they were handed as the first act of
plan_retention; these two skipped it, which left the trait method they must
implement with no caller at all. They now do what the others do.

The third is published.is_ok() inside an assert_eq! failure message, which runs
only when the assertion trips. Binding it before the comparison also drops the
second pass over the same Result, since the count above it already asked
whether the publish failed.
@gaborbernat gaborbernat added the bug Something isn't working label Sep 8, 2026
@codspeed-hq

codspeed-hq Bot commented Sep 8, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 29 untouched benchmarks
⏩ 133 skipped benchmarks1


Comparing fix/uncoverable-test-lines-2198 (d46eba4) with main (2d7849a)

Open in CodSpeed

Footnotes

  1. 133 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Validating before the panic moved the dead line rather than removing it: a
panic never completes, so its region never records, and the entry region that
had been covering that line moved to the validation above it. Two uncovered
lines became one.

The double now comes apart in validate_retention, and plan_retention is the
call that asks for it. Both methods the trait requires sit on the path the test
drives, each is a single statement its entry region covers, and the worker still
dies inside the plan exactly as the test asserts.
@gaborbernat
gaborbernat merged commit cb17628 into main Sep 8, 2026
20 checks passed
@gaborbernat
gaborbernat deleted the fix/uncoverable-test-lines-2198 branch September 8, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Coverage gate fails on main after #2178

1 participant