viettranx
|
abc6d62c95
|
test(providers,zalo): wave A coverage push
Push two deferred packages above their coverage floors:
- internal/providers 57.0% -> 62.2% (+5.2%, target ≥60%)
Targeted pure-logic adapter transformation code: registry,
openai/dashscope/codex ToRequest/FromResponse/FromStreamChunk,
Azure header branch, token source propagation, function_call +
incomplete + reasoning parse branches.
- internal/channels/zalo 7.2% -> 65.3% (+58.1%, target ≥20%)
Factory table-driven creds/config cases, New() defaults, callAPI
success/error/malformed, getMe/getUpdates, sendMessage/sendPhoto,
Send routing + photo extraction, Stop signal, processUpdate
dispatch, handleTextMessage empty-sender drop, downloadMedia four
branches (png/jpg fallback/404/empty).
Minimal refactor: converted package-level apiBase const to var in
internal/channels/zalo/zalo.go so tests can point at httptest server.
Zero runtime behavior change; tests restore the original value via
t.Cleanup.
Ratchet bumps (scripts/coverage_thresholds.json):
- internal/providers: 57.00 -> 62.15
- internal/channels/zalo: 7.20 -> 65.25
Race clean, dual build (default + -tags sqliteonly) clean,
personal/ sub-packages untouched.
|
2026-04-11 21:29:32 +07:00 |
|
viettranx
|
27c9415193
|
build(ci): add coverage ratchet gate with per-package floors
Add automated coverage floor validation:
- scripts/check_coverage.go: parses coverage.out, compares to per-package
thresholds, supports --update to lock current floors
- scripts/coverage_thresholds.json: 61 packages, initial floors from Phase 1
- .github/workflows/ci.yaml: new 'Coverage ratchet gate' step in CI
- internal/testutil/: test utilities (context builders, TestDB, doc.go)
|
2026-04-11 21:22:23 +07:00 |
|