✨ feat(server): /api/info aggregator + frontend version footer (#40)
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:
38
features/info/info.feature
Normal file
38
features/info/info.feature
Normal 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"
|
||||
16
features/info/info_test.go
Normal file
16
features/info/info_test.go
Normal 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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user