|
| 1 | +@endpoint(test-optimization) @endpoint(test-optimization-v2) |
| 2 | +Feature: Test Optimization |
| 3 | + Search or aggregate your test events over HTTP. See the [Test Optimization |
| 4 | + in Datadog](https://docs.datadoghq.com/tests/) page for more information. |
| 5 | + |
| 6 | + Background: |
| 7 | + Given a valid "apiKeyAuth" key in the system |
| 8 | + And a valid "appKeyAuth" key in the system |
| 9 | + And an instance of "TestOptimization" API |
| 10 | + |
| 11 | + @generated @skip @team:Datadog/ci-app-backend |
| 12 | + Scenario: Aggregate tests events returns "Bad Request" response |
| 13 | + Given new "AggregateCIAppTestEvents" request |
| 14 | + And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "@test.service:web-ui-tests AND @test.status:fail", "to": "now"}, "group_by": [{"facet": "@test.service", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc"}, "total": false}], "options": {"timezone": "GMT"}} |
| 15 | + When the request is sent |
| 16 | + Then the response status is 400 Bad Request |
| 17 | + |
| 18 | + @team:Datadog/ci-app-backend |
| 19 | + Scenario: Aggregate tests events returns "OK" response |
| 20 | + Given new "AggregateCIAppTestEvents" request |
| 21 | + And body with value {"compute": [{"aggregation": "count", "metric": "@test.is_flaky", "type": "total"}], "filter": {"from": "now-15m", "query": "@language:(python OR go)", "to": "now"}, "group_by": [{"facet": "@git.branch", "limit": 10, "sort": {"order": "asc"}, "total": false}], "options": {"timezone": "GMT"}} |
| 22 | + When the request is sent |
| 23 | + Then the response status is 200 OK |
| 24 | + And the response "meta.status" is equal to "done" |
| 25 | + |
| 26 | + @generated @skip @team:Datadog/ci-app-backend |
| 27 | + Scenario: Get a list of tests events returns "Bad Request" response |
| 28 | + Given new "ListCIAppTestEvents" request |
| 29 | + When the request is sent |
| 30 | + Then the response status is 400 Bad Request |
| 31 | + |
| 32 | + @team:Datadog/ci-app-backend |
| 33 | + Scenario: Get a list of tests events returns "OK" response |
| 34 | + Given new "ListCIAppTestEvents" request |
| 35 | + And request contains "filter[query]" parameter with value "@test.service:web-ui-tests" |
| 36 | + And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}" |
| 37 | + And request contains "filter[to]" parameter with value "{{ timeISO('now') }}" |
| 38 | + And request contains "page[limit]" parameter with value 5 |
| 39 | + When the request is sent |
| 40 | + Then the response status is 200 OK |
| 41 | + |
| 42 | + @replay-only @skip-validation @team:Datadog/ci-app-backend @with-pagination |
| 43 | + Scenario: Get a list of tests events returns "OK" response with pagination |
| 44 | + Given new "ListCIAppTestEvents" request |
| 45 | + And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}" |
| 46 | + And request contains "filter[to]" parameter with value "{{ timeISO('now') }}" |
| 47 | + And request contains "page[limit]" parameter with value 2 |
| 48 | + When the request with pagination is sent |
| 49 | + Then the response status is 200 OK |
| 50 | + And the response has 2 items |
| 51 | + |
| 52 | + @generated @skip @team:Datadog/ci-app-backend |
| 53 | + Scenario: Search tests events returns "Bad Request" response |
| 54 | + Given new "SearchCIAppTestEvents" request |
| 55 | + And body with value {"filter": {"from": "now-15m", "query": "@test.service:web-ui-tests AND @test.status:fail", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} |
| 56 | + When the request is sent |
| 57 | + Then the response status is 400 Bad Request |
| 58 | + |
| 59 | + @team:Datadog/ci-app-backend |
| 60 | + Scenario: Search tests events returns "OK" response |
| 61 | + Given new "SearchCIAppTestEvents" request |
| 62 | + And body with value {"filter": {"from": "now-15m", "query": "@test.service:web-ui-tests AND @test.status:skip", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 25}, "sort": "timestamp"} |
| 63 | + When the request is sent |
| 64 | + Then the response status is 200 OK |
| 65 | + |
| 66 | + @replay-only @skip-validation @team:Datadog/ci-app-backend @with-pagination |
| 67 | + Scenario: Search tests events returns "OK" response with pagination |
| 68 | + Given new "SearchCIAppTestEvents" request |
| 69 | + And body with value {"filter": {"from": "now-15m", "query": "@test.status:pass AND -@language:python", "to": "now"}, "page": {"limit": 2}, "sort": "timestamp"} |
| 70 | + When the request with pagination is sent |
| 71 | + Then the response status is 200 OK |
| 72 | + And the response has 2 items |
0 commit comments