Skip to content

Commit

Permalink
Add x-model header integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
alpe committed Feb 5, 2024
1 parent c1beaf3 commit c141853
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func TestRetryMiddleware(t *testing.T) {
"max retries - fails": {
serverCodes: []int{http.StatusServiceUnavailable, http.StatusServiceUnavailable, http.StatusServiceUnavailable, http.StatusBadGateway},
expResultCode: http.StatusBadGateway,
expResultBody: "{\"error\":\"Bad Gateway\"}\n", // note the linebreak
expResultBody: "502",
expBackendHits: 4,
},
"non retryable error code": {
Expand All @@ -196,6 +196,13 @@ func TestRetryMiddleware(t *testing.T) {
expResultBody: "200",
expBackendHits: 1,
},
"503 with model header": {
serverCodes: []int{http.StatusServiceUnavailable, http.StatusServiceUnavailable, http.StatusServiceUnavailable, http.StatusServiceUnavailable},
header: []tuple{{k: "X-Model", v: modelName}},
expResultCode: http.StatusServiceUnavailable,
expResultBody: "503",
expBackendHits: 4,
},
}
for name, spec := range specs {
t.Run(name, func(t *testing.T) {
Expand Down

0 comments on commit c141853

Please sign in to comment.