health_check's smoke path has no unit coverage — every test short-circuits before it #53
Labels
No labels
area/auth
area/backend
area/ci
area/deploy
area/e2e
area/frontend
area/shared
blocked
good-first-issue
needs-info
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
celilo/lunacycle#53
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while fixing #52. Separate defect, filing rather than growing that PR.
What
lunacycleHealthCheckgates its three public smoke checks on a secret:All 15 call sites in
health-check.test.tspasssecrets: {}. Not one setssmoketest_bot_password, so every test takes the skip branch.mintSmokeToken,runSpaSmoke,runApiSmokeCheckandrunWsSmokeCheckare never entered by any unittest, and neither is the
botTokenfalsy branch that suppresses the three checks aftera mint failure.
This was masked twice over: the directory was never typechecked (#52), and the tests
that do pass genuinely pass — they just never reach the code.
Why it matters
This is the branch that decides whether a deploy is healthy. It runs on every deploy,
on the 15m monitor, and via the
deploy.completedsubscriber. Its only proving groundtoday is production. A regression in the mint/smoke path is invisible until it fires
against the live fleet, and its failure mode is a deploy that reports healthy when it
is not — or one that fails and blocks a release for a reason no test can reproduce.
Fix
The seams already exist, so this needs no refactor:
deps.loadChromiumis an injectable override (documented as "Tests pass a stub here")and nothing passes one.
mintSmokeTokengoes through the injectedfetch, socreateMockFetchercan answerthe authentik token endpoint.
Worth covering, in rough priority:
smoketest_bot_passwordset + mint succeeds -> all three smoke checks run and theirresults reach
addCheck.not run (the comment claims this explicitly; nothing verifies it).
smoketest_bot_passwordabsent -> the skip is logged. This is the only branch withcoverage today, and only by accident.
Keep it focused — three tests, not a suite per helper.