Skip to content

tests: tighten coverage by retiring unreachable defensive code (wave 2)#2

Merged
TeoSlayer merged 1 commit into
mainfrom
coverage-housekeeping-wave2
May 28, 2026
Merged

tests: tighten coverage by retiring unreachable defensive code (wave 2)#2
TeoSlayer merged 1 commit into
mainfrom
coverage-housekeeping-wave2

Conversation

@TeoSlayer
Copy link
Copy Markdown
Contributor

Summary

  • Drop the json.Marshal error branch in writeAuditLineauditEvent is all primitives + time.Time, so marshal cannot fail. Replaced with _, _ = and a comment.

Coverage

  • Before: 95.4%
  • After: 95.6%

The remaining gap is real defensive code (disk I/O failures, exec failures, ctx-deadline timeouts) protecting the supervisor — left intact.

Test plan

  • go test -race -count=1 -timeout 120s ./... passes
  • Coverage moved measurably without gold-plating

writeAuditLine: json.Marshal on auditEvent (all primitives + time.Time)
cannot fail, so swap the error-handling branch for `_ = err` with a
comment explaining why the check was removed.

Coverage: 95.4% → 95.6% — small but honest. The remainder is real
defensive paths (disk I/O failures, exec failures, ctx-deadline
timeouts) that protect the supervisor and must stay.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@TeoSlayer TeoSlayer merged commit 76463d5 into main May 28, 2026
3 checks passed
@TeoSlayer TeoSlayer deleted the coverage-housekeeping-wave2 branch May 28, 2026 03:30
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.

2 participants