test: add a coverage floor, and cover the server and upgrade paths - #52
Merged
Conversation
The floor is the point. Two untested parsers, loadProjectList and routePath, each hid a bug for nine releases; a threshold is what stops the next one. Set just under the current numbers so a drop fails CI while an improvement does not, and verified to actually fail rather than pass silently — raising the bar above the current figure exits 1. Reaching a floor worth having meant covering the two big holes. server.ts was at 5.8%. The handlers now take a ServerDeps seam holding the project index, the per-project configs and the side effects, so a test drives them with a known world and records what they did: no socket, no database, no DDEV install. That covers the decisions rather than the plumbing — a project's own auth_policy overriding the global one while credentials stay server-wide, a second request during a start not queueing another ddev start, a failed start recording "stopped" instead of leaving the project wedged on "starting", and /__auth__?s=term reaching the auth handler, which is the query-string routing bug from 0.1.33 now pinned down. setup/upgrade.ts was at 18.9%. runUpgrade takes an UpgradeIo, which is what makes the re-exec path testable without replacing the process. The two guards worth having tests are both loops: no re-exec when npm served a stale cache and left the old version in place, and no second re-exec once one has happened. Agent coverage 66.8% -> 76.2%, server.ts 5.8% -> 66.7%, upgrade.ts 18.9% -> 66.7%. The CLI was already at 97%. Co-authored-by: Claude <claude@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #52 +/- ##
==========================================
+ Coverage 75.42% 82.12% +6.70%
==========================================
Files 35 35
Lines 1461 1466 +5
Branches 373 374 +1
==========================================
+ Hits 1102 1204 +102
+ Misses 292 219 -73
+ Partials 67 43 -24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
titouanmathis
added a commit
that referenced
this pull request
Sep 8, 2026
`test:integration:ci` collects coverage for Codecov's `integration` flag, so it inherited the thresholds from vite.config.ts. Those are the unit suite's floor; the integration suite exercises ssh.ts against a real SSH server and touches little else, so it reports 66% and the run failed with all of its tests passing. CI has been red on main since 0.1.39 was released — the gate from #52 was measuring the wrong suite. Also adds the regression test for the parent-directory bug, against real rsync in the container. Verified to have teeth: with the fix removed it fails with the same "change_dir ... failed: No such file or directory" the deployment hit, and passes with it. 14 integration tests. Co-authored-by: Claude <claude@anthropic.com> Claude-Session: https://claude.ai/code/session_016xdQPh3UcnZfjM5HS36ABP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The floor
test:cinow fails when coverage drops below a threshold set just under the current numbers — a regression fails, an improvement doesn't.Verified it actually bites, rather than passing silently:
This is the gate for the problem behind several fixes this cycle:
loadProjectListandroutePatheach had no tests and each hid a bug for nine releases.Reaching a floor worth having
server.ts: 5.8% → 66.7%. The handlers take aServerDepsseam holding the project index, the per-project configs and the side effects, so a test drives them with a known world and records what they did — no socket, no database, no DDEV install.The cases are about decisions, not plumbing:
auth_policyoverrides the global one, while credentials stay server-wideddev startstoppedrather than leaving the project wedged onstarting/__auth__?s=termreaches the auth handler — the query-string routing bug from 0.1.33, now pinned downsetup/upgrade.ts: 18.9% → 66.7%.runUpgradetakes anUpgradeIo, which is what makes the re-exec path testable without replacing the process. The two guards worth covering are both loops:Plus: an unreachable registry must not stop migrations that are already due.
Notes
Agent overall 66.8% → 76.2%. 474 tests, no mocks — the new fakes follow the injection convention from #51.
The floors are deliberately a ratchet, not a target.
server.tsstill has uncovered startup plumbing andupgrade.tsits process-level helpers; raise the numbers as those get covered.