fix: mock /healthz in runtime service e2e test
TestServiceStartGameEndToEnd's httptest server had no handler for /healthz, the path engineclient.Healthz probes after a runtime container starts. Without it the runtime never transitions out of starting state and the test fails on its 5s deadline. Surfaced by introducing CI that runs the backend service tests outside the integration harness. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -200,6 +200,8 @@ func TestServiceStartGameEndToEnd(t *testing.T) {
|
||||
engineSrv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
switch r.URL.Path {
|
||||
case "/healthz":
|
||||
w.WriteHeader(http.StatusOK)
|
||||
case "/api/v1/admin/init":
|
||||
_ = json.NewEncoder(w).Encode(rest.StateResponse{ID: gameID, Turn: 0, Players: []rest.PlayerState{{RaceName: "Alpha", Planets: 3, Population: 10}}})
|
||||
case "/api/v1/admin/status":
|
||||
|
||||
Reference in New Issue
Block a user