Skip to content

Commit

Permalink
Test feature flag endpoint in CI (#512)
Browse files Browse the repository at this point in the history
* Hit feature-flags endpoint in example app during CI Infra service tests
* Hit feature-flags endpoint in example app during Template only CI Infra tests

## Context

[This
commit](8bfab43)
broke the feature flag evidently integration (fixed now) but it was not
caught as part of any automated testing. This change adds a ping to the
feature-flags endpoint which integrates with Evidently to catch future
regressions.
  • Loading branch information
lorenyu authored Dec 14, 2023
1 parent 2d107a6 commit 062df44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions infra/test/infra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ func RunEndToEndTests(t *testing.T, terraformOptions *terraform.Options) {
http_helper.HttpGetWithRetryWithCustomValidation(t, serviceEndpoint, nil, 5, 1*time.Second, func(responseStatus int, responseBody string) bool {
return responseStatus == 200
})
// Hit feature flags endpoint to make sure Evidently integration is working
featureFlagsEndpoint := fmt.Sprintf("%s/feature-flags", serviceEndpoint)
http_helper.HttpGetWithRetryWithCustomValidation(t, featureFlagsEndpoint, nil, 5, 1*time.Second, func(responseStatus int, responseBody string) bool {
return responseStatus == 200
})
fmt.Println("::endgroup::")
}

Expand Down
7 changes: 7 additions & 0 deletions template-only-test/template_infra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ func ValidateDevEnvironment(t *testing.T) {
http_helper.HttpGetWithRetryWithCustomValidation(t, serviceEndpoint, nil, 10, 3*time.Second, func(responseStatus int, responseBody string) bool {
return responseStatus == 200
})

// Hit feature flags endpoint to make sure Evidently integration is working
featureFlagsEndpoint := fmt.Sprintf("%s/feature-flags", serviceEndpoint)
http_helper.HttpGetWithRetryWithCustomValidation(t, featureFlagsEndpoint, nil, 10, 3*time.Second, func(responseStatus int, responseBody string) bool {
return responseStatus == 200
})

fmt.Println("::endgroup::")
}

Expand Down

0 comments on commit 062df44

Please sign in to comment.