Skip to content

test: raise backend coverage to 88% (toward 90%) - #653

Merged
fclairamb merged 22 commits into
mainfrom
chore/spec-coverage-90
Oct 23, 2026
Merged

fclairamb merged 22 commits into
mainfrom
chore/spec-coverage-90

Conversation

@fclairamb

@fclairamb fclairamb commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Raises backend test coverage toward 90% (spec specs/todos/2026-10-23-03-coverage-90.md, still in specs/todos/: not done).

What changed

  • Full Postgres layer: 85.26% -> 88.3% (filtered with scripts/coverage.sh). 90% is not reached, about 1.7 points (~2700 statements) remain.
  • New shared DB dialect contract (server/internal/db/dbcontract/) run on SQLite and Postgres: orgs, severities, groups, maintenance, SLOs, escalation, on-call, dependencies, providers, tokens, passkeys, status pages, connections, events, labels, results, agents and enrollment tokens, contacts, notifications, publications.
  • Tests for handlers/checks dependencies and listing, checkminecraft, cmd/scenariodriver, cmd/loadgen, cmd/membench.
  • Ratchet: COVERAGE_MIN and Codecov targets raised from 80 to 88; wiki/testing/test-layers.md and wiki/testing/coverage.md updated.
  • No code excluded from the profile. No runtime behaviour change.

Remaining (next ticks)

Contract groups for device auth, state entries/events, check versions; handler tests for checks (clone, import), auth, incidents, integrations, statuspages, usernotifications, incidentpublications, telegramcb, agents; pkg/cli, jobs/jobtypes, slack/discord/msteams, mcp, small checkers. Not live-network or Docker code, a long tail of error branches.

Decided by autopilot

  • specs/todos/2026-10-23-03-coverage-90.md, open question (90% on which layer): the full Postgres layer, the number CI and Codecov report.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.42%. Comparing base (7cf836d) to head (4234909).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #653      +/-   ##
==========================================
+ Coverage   83.72%   85.42%   +1.70%     
==========================================
  Files        1271     1284      +13     
  Lines      129936   131047    +1111     
==========================================
+ Hits       108786   111948    +3162     
+ Misses      21141    19090    -2051     
  Partials        9        9              
Files with missing lines Coverage Δ
server/internal/db/dbcontract/agents.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/checkgroups.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/contract.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/escalation.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/identity.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/incidents.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/maintenance.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/notifications.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/organizations.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/reportschedules.go 100.00% <100.00%> (ø)
... and 3 more

... and 38 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

fclairamb and others added 16 commits October 23, 2026 17:27
…enance, SLOs, reports

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… dependencies

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…bove

Ratchet COVERAGE_MIN and the codecov targets from 80 to 85, the baseline
measured with COVER_FULL=1 (85.26%). 90% is not reached yet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t a fake server

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ervers

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nts and results groups

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Measured full layer: 87.5%.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…bove

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and status updates

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… sort modes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fclairamb fclairamb changed the title chore(specs): raise coverage to 90% test: raise backend coverage to 88% (toward 90%) Oct 23, 2026
@fclairamb
fclairamb enabled auto-merge (squash) October 23, 2026 19:11
@fclairamb
fclairamb merged commit 0051280 into main Oct 23, 2026
33 checks passed
@fclairamb
fclairamb deleted the chore/spec-coverage-90 branch October 23, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant