|
| 1 | +@endpoint(test-optimization) @endpoint(test-optimization-v2) |
| 2 | +Feature: Test Optimization |
| 3 | + Search and manage flaky tests through Test Optimization. See the [Test |
| 4 | + Optimization page](https://docs.datadoghq.com/tests/) for more |
| 5 | + information. |
| 6 | + |
| 7 | + Background: |
| 8 | + Given a valid "apiKeyAuth" key in the system |
| 9 | + And a valid "appKeyAuth" key in the system |
| 10 | + And an instance of "TestOptimization" API |
| 11 | + And operation "SearchFlakyTests" enabled |
| 12 | + And new "SearchFlakyTests" request |
| 13 | + |
| 14 | + @generated @skip @team:DataDog/ci-app-backend |
| 15 | + Scenario: Search flaky tests returns "Bad Request" response |
| 16 | + Given body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} |
| 17 | + When the request is sent |
| 18 | + Then the response status is 400 Bad Request |
| 19 | + |
| 20 | + @skip @team:DataDog/ci-app-backend |
| 21 | + Scenario: Search flaky tests returns "Bad Request" response with invalid limit |
| 22 | + Given body with value {"data": {"attributes": {"filter": {"query": "*"}, "page": {"limit": 2000}, "sort": "fqn"}, "type": "search_flaky_tests_request"}} |
| 23 | + When the request is sent |
| 24 | + Then the response status is 400 Bad Request |
| 25 | + |
| 26 | + @generated @skip @team:DataDog/ci-app-backend |
| 27 | + Scenario: Search flaky tests returns "OK" response |
| 28 | + Given body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} |
| 29 | + When the request is sent |
| 30 | + Then the response status is 200 OK |
| 31 | + |
| 32 | + @replay-only @skip @skip-validation @team:DataDog/ci-app-backend @with-pagination |
| 33 | + Scenario: Search flaky tests returns "OK" response with filtered query |
| 34 | + Given body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/cart-tracking\""}, "page": {"limit": 10}, "sort": "-last_flaked"}, "type": "search_flaky_tests_request"}} |
| 35 | + When the request with pagination is sent |
| 36 | + Then the response status is 200 OK |
| 37 | + |
| 38 | + @generated @skip @team:DataDog/ci-app-backend @with-pagination |
| 39 | + Scenario: Search flaky tests returns "OK" response with pagination |
| 40 | + Given body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} |
| 41 | + When the request with pagination is sent |
| 42 | + Then the response status is 200 OK |
0 commit comments