feat: expose build identity for release verification

This commit is contained in:
2026-09-20 18:26:00 +08:00
parent b53cffd07d
commit a1ba6cb145
9 changed files with 86 additions and 6 deletions

View File

@@ -22,6 +22,15 @@ func TestHealthSeparatesLivenessAndReadiness(t *testing.T) {
}
}
func TestVersionIsPublicAndBounded(t *testing.T) {
server := New("127.0.0.1:0", nil)
rr := httptest.NewRecorder()
server.Handler.ServeHTTP(rr, httptest.NewRequest(http.MethodGet, "/version", nil))
if rr.Code != http.StatusOK || !strings.Contains(rr.Body.String(), `"http_protocol_version":"1"`) || strings.Contains(rr.Body.String(), "ORBIT_MYSQL_DSN") {
t.Fatalf("unexpected version response: %d %s", rr.Code, rr.Body.String())
}
}
func TestMetricsListenerIsSeparateAndOptional(t *testing.T) {
metrics := observability.NewRegistry()
business := New("", nil)