feat: expose version identity in Go SDK
This commit is contained in:
@@ -15,6 +15,10 @@ func TestHealthContract(t *testing.T) {
|
||||
if r.Method != "GET" || r.Header.Get("Accept") != "application/json" {
|
||||
t.Error("incorrect request")
|
||||
}
|
||||
if r.URL.Path == "/version" {
|
||||
_, _ = w.Write([]byte(`{"version":"1.2.3","revision":"abc","built_at":"now","go_version":"go1.27.1","http_protocol_version":"1","worker_protocol_version":"1","event_protocol_version":"1","workflow_schema_version":1}`))
|
||||
return
|
||||
}
|
||||
if r.URL.Path == "/health/live" {
|
||||
_, _ = w.Write([]byte(`{"status":"alive"}`))
|
||||
return
|
||||
@@ -31,6 +35,10 @@ func TestHealthContract(t *testing.T) {
|
||||
if err != nil || live.Status != "alive" {
|
||||
t.Fatalf("%+v %v", live, err)
|
||||
}
|
||||
info, err := client.Version(context.Background())
|
||||
if err != nil || info.Version != "1.2.3" || info.Revision != "abc" || info.WorkflowSchemaVersion != 1 {
|
||||
t.Fatalf("version=%+v err=%v", info, err)
|
||||
}
|
||||
_, err = client.Readiness(context.Background())
|
||||
var status *orbit.HTTPError
|
||||
if !errors.As(err, &status) || status.StatusCode != 503 || strings.Contains(err.Error(), "secret") {
|
||||
|
||||
Reference in New Issue
Block a user