Add tests for globals, healthcheck, and logger packages (closes #110)
check / check (push) Failing after 1s

These three packages had no tests. Add behavioural, external
(package foo_test) tests that can each fail on a plausible break:

- globals: setters and read-back through New, plus that New returns
  an independent snapshot. One sequential function with a disclosed
  paralleltest suppression, because it mutates shared package globals.
- healthcheck: Check returns status "ok", the exact documented JSON
  field set, an RFC3339Nano timestamp, maintenanceMode mirroring the
  config in both states, and the version and appname from globals.
- logger: New yields a usable *slog.Logger, debug is suppressed at the
  default level, and EnableDebugLogging turns it on.

No production code changed. TTY-branch output format is not asserted.

Model: opus-4-8
This commit is contained in:
2026-09-21 07:48:43 +00:00
parent b351a2350c
commit 218abb4daf
4 changed files with 252 additions and 0 deletions
+2
View File
@@ -23,6 +23,8 @@ Rationale, Design, TODO, License, Author) if any are still missing.
# Completed Steps
- 2026-09-21: added behavioural tests for `internal/globals`,
`internal/healthcheck`, and `internal/logger` (closes #110).
- 2026-09-21: `go mod tidy` dropped the redundant `golang.org/x/sync`
`// indirect` line so `script/bootstrap` leaves a clean tree (#132)
- 2026-08-10: comment-only corrections to `script/bootstrap`,