Test that maintenance mode refuses image requests (closes #71)
check / check (push) Failing after 2m20s

Failing tests, ahead of the change: with maintenance_mode on, both image
routes must answer 503 with a Retry-After header and the JSON error body,
while the health check keeps answering 200 and reporting
maintenance_mode, and the login page and /metrics keep answering 200.
The test server now also builds the health check, which these tests
request.

Model: opus-5-5
This commit is contained in:
2026-09-29 04:13:23 +00:00
parent 1b920fe000
commit 65cbf3f4f5
2 changed files with 136 additions and 1 deletions
@@ -18,6 +18,7 @@ import (
"sneak.berlin/go/pixa/internal/database"
"sneak.berlin/go/pixa/internal/globals"
"sneak.berlin/go/pixa/internal/handlers"
"sneak.berlin/go/pixa/internal/healthcheck"
"sneak.berlin/go/pixa/internal/logger"
"sneak.berlin/go/pixa/internal/middleware"
)
@@ -70,8 +71,15 @@ func newTestServer(t *testing.T) *Server {
t.Fatalf("database.New() error = %v", err)
}
hc, err := healthcheck.New(lc, healthcheck.Params{
Globals: &globals.Globals{}, Config: cfg, Logger: log, Database: db,
})
if err != nil {
t.Fatalf("healthcheck.New() error = %v", err)
}
h, err := handlers.New(lc, handlers.Params{
Logger: log, Database: db, Config: cfg,
Logger: log, Healthcheck: hc, Database: db, Config: cfg,
})
if err != nil {
t.Fatalf("handlers.New() error = %v", err)