Files
dance-lessons-coach/pkg/bdd/steps/health_steps.go
Gabriel Radureau 045823ec8e
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 17s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m28s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped
feat(server): add /api/healthz endpoint with rich health info (#20)
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>
2026-05-03 12:25:54 +02:00

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)
}