test: measure coverage in ci (report-only) #5
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-payment!5
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "test/coverage"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Adds
@vitest/coverage-v8and runs it in CI (#58). Report-only — no thresholds are configured,so this cannot fail a build. The point is to make the gaps visible before deciding where to gate.
Three of the four TS repos already had a
coverageblock invitest.config.tsbut no providerinstalled, so it had never actually run.
What it found
provider/mollie.ts54.9% (lines 182-270 — the subscription, refund and getStatus methods)forgejo-http.ts0% (211 lines that mutate production Forgejo),kanidm-http.ts0%,http.ts0%server.ts0% — the HTTP server itselfmiddleware.ts0% (every request),captcha.ts0% (150 lines gating sign-up),auth/guard.ts0% (the authorisation gate),rate-limit.ts0%,auth/session.ts23.7%Two results worth calling out.
bitborg-payment's money core is at 100%.
money.ts,vat.ts,pricing.ts,entitlements.tsandconfig.tsdo not appear in the report at all, because the table only lists files with uncoveredlines. The entire shortfall is the provider adapter, which matches the untested-methods finding filed
separately.
bitborg-web's real number is 40.5%, not the 62.6% it reports without
coverage.include. This isthe one non-obvious part of the change: without
include, v8 only reports files that a test happenedto import, so a file with no test is absent from the report entirely rather than showing as 0%.
guard.ts,captcha.ts,middleware.tsandrate-limit.tswere all invisible. Addingcoverage.includeforsrc/lib/**+src/middleware.tsis what surfaced them, and it moved theheadline number down 22 points. A coverage figure that omits untested files flatters exactly the code
you most want to find.
Next, deliberately not in this PR
Per-glob thresholds (
{ 100: true }on the money modules andsrc/lib/auth/**, negative-thresholdratchets elsewhere) and the tests those thresholds would demand. Writing the tests is the actual
deliverable; the number is just the map. Gating on a 40% baseline today would only lock in the status
quo.
Also added
coverage/to bitborg-web's.gitignore— the other three already ignored it.Refs #58
fdeec79271e8ef227957