Skip to content

[codex] improve unit test coverage#600

Merged
abtreece merged 2 commits into
mainfrom
codex/improve-unit-test-coverage
May 8, 2026
Merged

[codex] improve unit test coverage#600
abtreece merged 2 commits into
mainfrom
codex/improve-unit-test-coverage

Conversation

@abtreece
Copy link
Copy Markdown
Owner

@abtreece abtreece commented May 7, 2026

Summary

  • add explicit unit, coverage, and race Make targets
  • add reload manager tests for subscriber notification and non-blocking triggers
  • expand detailed health coverage for metrics, env, types, DynamoDB, SSM, and Secrets Manager

Testing

  • go test ./pkg/...
  • make unit
  • go test -race ./pkg/service ./pkg/metrics ./pkg/backends/dynamodb ./pkg/backends/ssm ./pkg/backends/secretsmanager ./pkg/backends/types
  • git diff --check

Notes

Coverage across ./pkg/... improved from 76.0% to 78.7%.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.83%. Comparing base (5a4adc2) to head (819e212).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #600      +/-   ##
==========================================
+ Coverage   67.43%   70.83%   +3.40%     
==========================================
  Files          53       53              
  Lines        5644     5644              
==========================================
+ Hits         3806     3998     +192     
+ Misses       1612     1418     -194     
- Partials      226      228       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@abtreece abtreece marked this pull request as ready for review May 7, 2026 21:26
Copilot AI review requested due to automatic review settings May 7, 2026 21:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR focuses on improving confidence in confd by expanding unit test coverage across the reload manager, metrics health endpoints, and multiple backend detailed health checks, while also adding explicit Make targets for unit, coverage, and race testing.

Changes:

  • Added Makefile targets for unit, coverage, and race test workflows.
  • Added/expanded tests for reload notifications and non-blocking reload triggers.
  • Expanded detailed health check test coverage across metrics and several backends (Env, DynamoDB, SSM, Secrets Manager, and shared types).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Makefile Adds explicit unit, coverage, and race targets for testing workflows.
pkg/service/reload_test.go New tests validating reload manager subscription behavior and non-blocking triggers under concurrency.
pkg/metrics/health_test.go Adds coverage for ReadyDetailedHandler success/error paths and fallback behavior.
pkg/metrics/backend_test.go Adds tests for instrumented detailed health checks and Close() delegation behavior.
pkg/backends/types/noop_test.go Adds JSON marshaling coverage for DurationMillis.
pkg/backends/env/client_test.go Adds HealthCheckDetailed coverage for the env backend.
pkg/backends/dynamodb/client_test.go Adds HealthCheckDetailed success/error test coverage for DynamoDB backend.
pkg/backends/ssm/client_test.go Adds HealthCheckDetailed success/error test coverage for SSM backend.
pkg/backends/secretsmanager/client_test.go Adds HealthCheckDetailed success/error test coverage for Secrets Manager backend.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile Outdated
@@ -1,4 +1,4 @@
.PHONY: build install clean lint test integration dep release
.PHONY: build install clean lint test unit coverage race integration dep release
@abtreece abtreece merged commit 78e3430 into main May 8, 2026
15 checks passed
@abtreece abtreece deleted the codex/improve-unit-test-coverage branch May 8, 2026 00:40
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