effe6675bc
Tests · Go / test (push) Successful in 32s
- go.work (Go 1.26.3) with backend module; deps added incrementally (gin+zap only) - backend: /healthz + /readyz, env config, graceful shutdown - docs: ARCHITECTURE, FUNCTIONAL (+ru mirror), TESTING - PLAN.md (stage tracker + per-stage open details) and CLAUDE.md (per-stage workflow) - .gitea go-unit CI (gofmt/vet/build/test)
23 lines
537 B
Go
23 lines
537 B
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"go.uber.org/zap/zaptest"
|
|
)
|
|
|
|
// TestProbes verifies that the infrastructure probes answer 200 OK.
|
|
func TestProbes(t *testing.T) {
|
|
srv := New(":0", zaptest.NewLogger(t))
|
|
for _, path := range []string{"/healthz", "/readyz"} {
|
|
req := httptest.NewRequest(http.MethodGet, path, nil)
|
|
rec := httptest.NewRecorder()
|
|
srv.http.Handler.ServeHTTP(rec, req)
|
|
if rec.Code != http.StatusOK {
|
|
t.Fatalf("%s: status = %d, want %d", path, rec.Code, http.StatusOK)
|
|
}
|
|
}
|
|
}
|