feat(server): /api/info aggregator + frontend version footer (#40)
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 9s
CI/CD Pipeline / CI Pipeline (push) Failing after 4m48s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped

Co-authored-by: Gabriel Radureau <arcodange@gmail.com>
Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
This commit was merged in pull request #40.
This commit is contained in:
2026-05-05 08:29:26 +02:00
committed by arcodange
parent 4a3f1bb138
commit a2beadc458
16 changed files with 587 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
# features/info/info.feature
@info @critical
Feature: Info Endpoint
The /api/info endpoint should return composite application information
@basic @critical
Scenario: GET /api/info returns all required fields
Given the server is running
When I request the info endpoint
Then the status code should be 200
And the response should be JSON
And the response should contain "version"
And the response should contain "commit_short"
And the response should contain "build_date"
And the response should contain "uptime_seconds"
And the response should contain "cache_enabled"
And the response should contain "healthz_status"
And the "healthz_status" field should equal "healthy"
@version @critical
Scenario: version field matches semantic version pattern
Given the server is running
When I request the info endpoint
Then the status code should be 200
And the "version" field should match /^\d+\.\d+\.\d+$/
@cache @skip @bdd-deferred
Scenario: /api/info is cached when cache is enabled
# Deferred: the BDD testsetup currently runs with cache disabled
# (see "Cache service disabled" in test logs). Cache HIT/MISS behavior
# is covered by unit tests on the cache service. Reopen this scenario
# if/when the BDD harness gains a cache-enabled mode (likely after
# ADR-0022 Phase 2).
Given the server is running with cache enabled
When I request the info endpoint
Then the response header "X-Cache" should be "MISS"
When I request the info endpoint again
Then the response header "X-Cache" should be "HIT"

View File

@@ -0,0 +1,16 @@
package info
import (
"testing"
"dance-lessons-coach/pkg/bdd/testsetup"
)
func TestInfoBDD(t *testing.T) {
config := testsetup.NewFeatureConfig("info", "progress", false)
suite := testsetup.CreateTestSuite(t, config, "dance-lessons-coach BDD Tests - Info Feature")
if suite.Run() != 0 {
t.Fatal("non-zero status returned, failed to run info BDD tests")
}
}