Skip to content

test: close the two branch coverage gaps - #83

Merged
koji-1009 merged 1 commit into
mainfrom
test/close-branch-coverage-gaps
Aug 14, 2026
Merged

koji-1009 merged 1 commit into
mainfrom
test/close-branch-coverage-gaps

Conversation

@koji-1009

Copy link
Copy Markdown
Owner

Branch coverage has not been 100% in CI for at least two months — the latest run on main reports 99.36%. Two branches were never taken.

cache.ts:28

const toolCache = process.env.RUNNER_TOOL_CACHE || "/opt/hostedtoolcache";

A runner always sets RUNNER_TOOL_CACHE, so the fallback is only reached when a test clears it. Locally the opposite holds — the variable is unset, so the fallback is taken naturally and the gap is invisible outside CI.

version.ts:112

The error instanceof Error ? error : new Error(String(error)) wrapper in fetchManifest had no test for a rejection that is not an Error.

Why Codecov still shows 100%

The clover report records both lines as type="cond" truecount="1" falsecount="1" — fully covered — so the uncovered branches never reach the upload. Codecov's headline number is line coverage, which has been 100% throughout.

Verified 317/317 both with and without RUNNER_TOOL_CACHE set.

🤖 Generated with Claude Code

Branch coverage has not been 100% in CI for at least two months
(99.36% on the latest main run). Two branches were never taken:

- cache.ts:28 - the "/opt/hostedtoolcache" fallback. A runner always
  sets RUNNER_TOOL_CACHE, so the fallback is only reached when a test
  clears it. Locally the opposite holds, which is why this gap is
  invisible outside CI.
- version.ts:112 - the wrapper for a rejection that is not an Error.

Neither surfaces on Codecov: the clover report records both lines as
type="cond" truecount="1" falsecount="1", so the uncovered branches
never reach the upload.

Verified 317/317 both with and without RUNNER_TOOL_CACHE set.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@koji-1009
koji-1009 merged commit f0adaa5 into main Aug 14, 2026
8 checks passed
@koji-1009
koji-1009 deleted the test/close-branch-coverage-gaps branch August 14, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant