🧪 test(coverage): remove three lines no run can execute - #2202
Merged
Conversation
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.
Merging this PR will not alter performance
Comparing Footnotes
|
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.
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.
mainhas 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 -Son 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 at0df149bfcwas 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_retentionon the retention doubles #2178 added. The trait requires the method, so neither body can go away, and a default returningOk(())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 ofplan_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 insidevalidate_retention, withplan_retentionas 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 anassert_eq!failure message, which evaluates only when the assertion trips, and the line above it already asked the sameResultwhether the publish failed. Binding the answer once before the comparison removes the unreachable evaluation and the second pass over theResulttogether.Measured rather than reasoned.
cargo llvm-cov nextest -p peryx-driver -p peryx-ecosystem-ocinow reports neithertests/unit/retention/tests.rsnortests/unit/quota/tests.rsin its uncovered list, and 1908 tests pass across the two crates.Closes #2199