Adds Kubernetes-style /api/healthz endpoint with status/version/uptime_seconds/timestamp. Non-breaking — /api/health preserved. Includes unit test (passes locally) and BDD scenario (validated by CI). Généré ~95% en autonomie par Mistral Vibe via workspace ICM ~/Work/Vibe/workspaces/healthz-feature/. Co-authored-by: Gabriel Radureau <arcodange@gmail.com> Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
35 lines
927 B
Go
35 lines
927 B
Go
package steps
|
|
|
|
import (
|
|
"dance-lessons-coach/pkg/bdd/testserver"
|
|
)
|
|
|
|
// HealthSteps holds health-related step definitions
|
|
type HealthSteps struct {
|
|
client *testserver.Client
|
|
scenarioKey string // Track current scenario for state isolation
|
|
}
|
|
|
|
func NewHealthSteps(client *testserver.Client) *HealthSteps {
|
|
return &HealthSteps{client: client}
|
|
}
|
|
|
|
// SetScenarioKey sets the current scenario key for state isolation
|
|
func (s *HealthSteps) SetScenarioKey(key string) {
|
|
s.scenarioKey = key
|
|
}
|
|
|
|
// Health-related steps
|
|
func (s *HealthSteps) iRequestTheHealthEndpoint() error {
|
|
return s.client.Request("GET", "/api/health", nil)
|
|
}
|
|
|
|
func (s *HealthSteps) iRequestTheHealthzEndpoint() error {
|
|
return s.client.Request("GET", "/api/healthz", nil)
|
|
}
|
|
|
|
func (s *HealthSteps) theServerIsRunning() error {
|
|
// Actually verify the server is running by checking the readiness endpoint
|
|
return s.client.Request("GET", "/api/ready", nil)
|
|
}
|