Skip to content

test: set minimum unit test coverage thresholds#486

Merged
cameri merged 2 commits intomainfrom
feat/minimum-coverage-threshold
Apr 18, 2026
Merged

test: set minimum unit test coverage thresholds#486
cameri merged 2 commits intomainfrom
feat/minimum-coverage-threshold

Conversation

@phoenix-server
Copy link
Copy Markdown
Collaborator

@phoenix-server phoenix-server commented Apr 18, 2026

Summary

  • Locks nyc coverage thresholds to current measured levels to prevent regressions
  • Thresholds: Statements 55%, Branches 47%, Functions 48%, Lines 54%
  • Watermarks updated to [current, 80] — tracks progress toward the 80% goal

Test plan

  • npm run cover:unit passes without coverage threshold errors
  • Verify CI passes with the new thresholds

🤖 Generated with Claude Code

Statements: 55%, Branches: 47%, Functions: 48%, Lines: 54%.
Watermarks updated to [current, 80] to track progress toward goal.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@cameri cameri self-assigned this Apr 18, 2026
@cameri cameri requested a review from Copilot April 18, 2026 12:59
@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 24605176228

Coverage remained the same at 54.843%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2948
Covered Lines: 1669
Line Coverage: 56.61%
Relevant Branches: 1213
Covered Branches: 613
Branch Coverage: 50.54%
Branches in Coverage %: Yes
Coverage Strength: 9.3 hits per line

💛 - Coveralls

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

Updates NYC (Istanbul) configuration to align coverage thresholds and report watermarks with the project’s current measured coverage levels, aiming to prevent coverage regressions and visualize progress toward an 80% goal.

Changes:

  • Lowered NYC global coverage thresholds to current baseline values (Statements 55%, Branches 47%, Functions 48%, Lines 54%).
  • Updated NYC report watermarks to [current, 80] for each metric.

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

Comment thread .nycrc.json
Comment on lines +4 to +7
"branches": 47,
"lines": 54,
"functions": 48,
"statements": 55,
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

The numeric thresholds (branches/lines/functions/statements) are only enforced by nyc when coverage checking is enabled (e.g., via --check-coverage or "check-coverage": true). As written, CI runs nyc ... npm run test:unit without --check-coverage, so these values may not actually prevent coverage regressions despite the PR description. Consider enabling check-coverage in this config or adding --check-coverage to the cover:* scripts.

Copilot uses AI. Check for mistakes.
Comment thread .nycrc.json
Comment on lines +4 to +7
"branches": 47,
"lines": 54,
"functions": 48,
"statements": 55,
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

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

This .nycrc.json is used by both cover:unit and cover:integration (the integration docker compose mounts it into the container). Lowering thresholds/watermarks here will apply to integration coverage too, even though the PR title/description frames this as “unit test” thresholds. If the intent is unit-only gating, consider splitting configs (e.g., .nycrc.unit.json / .nycrc.integration.json) and pointing each script to the appropriate file.

Copilot uses AI. Check for mistakes.
@cameri cameri merged commit ef9209c into main Apr 18, 2026
10 checks passed
@cameri cameri deleted the feat/minimum-coverage-threshold branch April 18, 2026 13:02
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.

4 participants