From 40afa912239ff2922d3cfae2e083d5cfb8198774 Mon Sep 17 00:00:00 2001 From: Anika Maskara Date: Thu, 13 Feb 2025 12:03:19 -0500 Subject: [PATCH 1/2] remove CI Visibility Tests feature file --- tests/v2/features/ci_visibility_tests.feature | 73 ------------------- 1 file changed, 73 deletions(-) delete mode 100644 tests/v2/features/ci_visibility_tests.feature diff --git a/tests/v2/features/ci_visibility_tests.feature b/tests/v2/features/ci_visibility_tests.feature deleted file mode 100644 index 9d6f849b20..0000000000 --- a/tests/v2/features/ci_visibility_tests.feature +++ /dev/null @@ -1,73 +0,0 @@ -@endpoint(ci-visibility-tests) @endpoint(ci-visibility-tests-v2) -Feature: CI Visibility Tests - Search or aggregate your CI Visibility test events over HTTP. See the - [Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for - more information. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "CIVisibilityTests" API - - @generated @skip @team:Datadog/ci-app-backend - Scenario: Aggregate tests events returns "Bad Request" response - Given new "AggregateCIAppTestEvents" request - 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"}} - When the request is sent - Then the response status is 400 Bad Request - - @team:Datadog/ci-app-backend - Scenario: Aggregate tests events returns "OK" response - Given new "AggregateCIAppTestEvents" request - 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"}} - When the request is sent - Then the response status is 200 OK - And the response "meta.status" is equal to "done" - - @generated @skip @team:Datadog/ci-app-backend - Scenario: Get a list of tests events returns "Bad Request" response - Given new "ListCIAppTestEvents" request - When the request is sent - Then the response status is 400 Bad Request - - @team:Datadog/ci-app-backend - Scenario: Get a list of tests events returns "OK" response - Given new "ListCIAppTestEvents" request - And request contains "filter[query]" parameter with value "@test.service:web-ui-tests" - And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}" - And request contains "filter[to]" parameter with value "{{ timeISO('now') }}" - And request contains "page[limit]" parameter with value 5 - When the request is sent - Then the response status is 200 OK - - @replay-only @skip-validation @team:Datadog/ci-app-backend @with-pagination - Scenario: Get a list of tests events returns "OK" response with pagination - Given new "ListCIAppTestEvents" request - And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}" - And request contains "filter[to]" parameter with value "{{ timeISO('now') }}" - And request contains "page[limit]" parameter with value 2 - When the request with pagination is sent - Then the response status is 200 OK - And the response has 2 items - - @generated @skip @team:Datadog/ci-app-backend - Scenario: Search tests events returns "Bad Request" response - Given new "SearchCIAppTestEvents" request - 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"} - When the request is sent - Then the response status is 400 Bad Request - - @team:Datadog/ci-app-backend - Scenario: Search tests events returns "OK" response - Given new "SearchCIAppTestEvents" request - 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"} - When the request is sent - Then the response status is 200 OK - - @replay-only @skip-validation @team:Datadog/ci-app-backend @with-pagination - Scenario: Search tests events returns "OK" response with pagination - Given new "SearchCIAppTestEvents" request - And body with value {"filter": {"from": "now-15m", "query": "@test.status:pass AND -@language:python", "to": "now"}, "page": {"limit": 2}, "sort": "timestamp"} - When the request with pagination is sent - Then the response status is 200 OK - And the response has 2 items From f65aa75272696fdfda3473b9a5bfc15d50c63f6d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 13 Feb 2025 17:04:59 +0000 Subject: [PATCH 2/2] Regenerate client from commit 393eda14 of spec repo --- .apigentools-info | 8 +-- .generator/schemas/v2/openapi.yaml | 25 +++---- docs/datadog_api_client.v2.api.rst | 14 ++-- .../AggregateCIAppTestEvents.py | 4 +- .../ListCIAppTestEvents.py | 4 +- .../ListCIAppTestEvents_3852605281.py | 4 +- .../SearchCIAppTestEvents.py | 4 +- .../SearchCIAppTestEvents_1675695429.py | 4 +- ..._tests_api.py => test_optimization_api.py} | 10 +-- src/datadog_api_client/v2/apis/__init__.py | 4 +- .../v2/model/ci_app_event_attributes.py | 2 +- tests/v2/features/test_optimization.feature | 72 +++++++++++++++++++ tests/v2/features/undo.json | 6 +- 13 files changed, 115 insertions(+), 46 deletions(-) rename examples/v2/{ci-visibility-tests => test-optimization}/AggregateCIAppTestEvents.py (92%) rename examples/v2/{ci-visibility-tests => test-optimization}/ListCIAppTestEvents.py (79%) rename examples/v2/{ci-visibility-tests => test-optimization}/ListCIAppTestEvents_3852605281.py (79%) rename examples/v2/{ci-visibility-tests => test-optimization}/SearchCIAppTestEvents.py (88%) rename examples/v2/{ci-visibility-tests => test-optimization}/SearchCIAppTestEvents_1675695429.py (87%) rename src/datadog_api_client/v2/api/{ci_visibility_tests_api.py => test_optimization_api.py} (94%) create mode 100644 tests/v2/features/test_optimization.feature diff --git a/.apigentools-info b/.apigentools-info index 4aa75e8096..e5c0fc49da 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-02-12 18:33:47.788334", - "spec_repo_commit": "6a4cfb82" + "regenerated": "2025-02-13 17:04:01.282746", + "spec_repo_commit": "393eda14" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-02-12 18:33:47.802844", - "spec_repo_commit": "6a4cfb82" + "regenerated": "2025-02-13 17:04:01.301910", + "spec_repo_commit": "393eda14" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5e1dce10cc..2fb1ae8391 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3741,7 +3741,7 @@ components: properties: attributes: additionalProperties: {} - description: JSON object of attributes from CI Visibility test events. + description: JSON object of attributes from Test Optimization test events. example: customAttribute: 123 duration: 2345 @@ -35086,8 +35086,8 @@ paths: - ci_visibility_read /api/v2/ci/tests/analytics/aggregate: post: - description: The API endpoint to aggregate CI Visibility test events into buckets - of computed metrics and timeseries. + description: The API endpoint to aggregate test events into buckets of computed + metrics and timeseries. operationId: AggregateCIAppTestEvents requestBody: content: @@ -35115,7 +35115,7 @@ paths: - ci_visibility_read summary: Aggregate tests events tags: - - CI Visibility Tests + - Test Optimization x-codegen-request-body-name: body x-permission: operator: OR @@ -35123,8 +35123,7 @@ paths: - ci_visibility_read /api/v2/ci/tests/events: get: - description: 'List endpoint returns CI Visibility test events that match a [search - query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/). + description: 'List endpoint returns test events that match a [search query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/). [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). @@ -35199,7 +35198,7 @@ paths: - ci_visibility_read summary: Get a list of tests events tags: - - CI Visibility Tests + - Test Optimization x-pagination: cursorParam: page[cursor] cursorPath: meta.page.after @@ -35211,8 +35210,7 @@ paths: - ci_visibility_read /api/v2/ci/tests/events/search: post: - description: 'List endpoint returns CI Visibility test events that match a [search - query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/). + description: 'List endpoint returns test events that match a [search query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/). [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). @@ -35245,7 +35243,7 @@ paths: - ci_visibility_read summary: Search tests events tags: - - CI Visibility Tests + - Test Optimization x-codegen-request-body-name: body x-pagination: cursorParam: body.page.cursor @@ -51224,10 +51222,6 @@ tags: to your Datadog site over HTTP. See the [CI Pipeline Visibility in Datadog page](https://docs.datadoghq.com/continuous_integration/pipelines/) for more information. name: CI Visibility Pipelines -- description: Search or aggregate your CI Visibility test events over HTTP. See the - [Test Visibility in Datadog page](https://docs.datadoghq.com/tests/) for more - information. - name: CI Visibility Tests - description: 'Datadog Cloud Security Management (CSM) delivers real-time threat detection @@ -51574,6 +51568,9 @@ tags: - description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information. name: Teams +- description: Search or aggregate your test events over HTTP. See the [Test Optimization + in Datadog](https://docs.datadoghq.com/tests/) page for more information. + name: Test Optimization - description: 'The usage metering API allows you to get hourly, daily, and monthly usage across multiple facets of Datadog. diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 80e72249a9..fe075b03eb 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -81,13 +81,6 @@ datadog\_api\_client.v2.api.ci\_visibility\_pipelines\_api module :members: :show-inheritance: -datadog\_api\_client.v2.api.ci\_visibility\_tests\_api module -------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.api.ci_visibility_tests_api - :members: - :show-inheritance: - datadog\_api\_client.v2.api.cloud\_cost\_management\_api module --------------------------------------------------------------- @@ -431,6 +424,13 @@ datadog\_api\_client.v2.api.teams\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.test\_optimization\_api module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.test_optimization_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.usage\_metering\_api module ------------------------------------------------------- diff --git a/examples/v2/ci-visibility-tests/AggregateCIAppTestEvents.py b/examples/v2/test-optimization/AggregateCIAppTestEvents.py similarity index 92% rename from examples/v2/ci-visibility-tests/AggregateCIAppTestEvents.py rename to examples/v2/test-optimization/AggregateCIAppTestEvents.py index 9842c94047..0bc59035b8 100644 --- a/examples/v2/ci-visibility-tests/AggregateCIAppTestEvents.py +++ b/examples/v2/test-optimization/AggregateCIAppTestEvents.py @@ -3,7 +3,7 @@ """ from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi +from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi from datadog_api_client.v2.model.ci_app_aggregate_sort import CIAppAggregateSort from datadog_api_client.v2.model.ci_app_aggregation_function import CIAppAggregationFunction from datadog_api_client.v2.model.ci_app_compute import CIAppCompute @@ -44,7 +44,7 @@ configuration = Configuration() with ApiClient(configuration) as api_client: - api_instance = CIVisibilityTestsApi(api_client) + api_instance = TestOptimizationApi(api_client) response = api_instance.aggregate_ci_app_test_events(body=body) print(response) diff --git a/examples/v2/ci-visibility-tests/ListCIAppTestEvents.py b/examples/v2/test-optimization/ListCIAppTestEvents.py similarity index 79% rename from examples/v2/ci-visibility-tests/ListCIAppTestEvents.py rename to examples/v2/test-optimization/ListCIAppTestEvents.py index d962ef6162..e76c85c066 100644 --- a/examples/v2/ci-visibility-tests/ListCIAppTestEvents.py +++ b/examples/v2/test-optimization/ListCIAppTestEvents.py @@ -5,11 +5,11 @@ from datetime import datetime from dateutil.relativedelta import relativedelta from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi +from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi configuration = Configuration() with ApiClient(configuration) as api_client: - api_instance = CIVisibilityTestsApi(api_client) + api_instance = TestOptimizationApi(api_client) response = api_instance.list_ci_app_test_events( filter_query="@test.service:web-ui-tests", filter_from=(datetime.now() + relativedelta(seconds=-30)), diff --git a/examples/v2/ci-visibility-tests/ListCIAppTestEvents_3852605281.py b/examples/v2/test-optimization/ListCIAppTestEvents_3852605281.py similarity index 79% rename from examples/v2/ci-visibility-tests/ListCIAppTestEvents_3852605281.py rename to examples/v2/test-optimization/ListCIAppTestEvents_3852605281.py index bee9b0f14b..c17e0d8276 100644 --- a/examples/v2/ci-visibility-tests/ListCIAppTestEvents_3852605281.py +++ b/examples/v2/test-optimization/ListCIAppTestEvents_3852605281.py @@ -5,11 +5,11 @@ from datetime import datetime from dateutil.relativedelta import relativedelta from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi +from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi configuration = Configuration() with ApiClient(configuration) as api_client: - api_instance = CIVisibilityTestsApi(api_client) + api_instance = TestOptimizationApi(api_client) items = api_instance.list_ci_app_test_events_with_pagination( filter_from=(datetime.now() + relativedelta(seconds=-30)), filter_to=datetime.now(), diff --git a/examples/v2/ci-visibility-tests/SearchCIAppTestEvents.py b/examples/v2/test-optimization/SearchCIAppTestEvents.py similarity index 88% rename from examples/v2/ci-visibility-tests/SearchCIAppTestEvents.py rename to examples/v2/test-optimization/SearchCIAppTestEvents.py index 3e4bdfad3d..5afee03564 100644 --- a/examples/v2/ci-visibility-tests/SearchCIAppTestEvents.py +++ b/examples/v2/test-optimization/SearchCIAppTestEvents.py @@ -3,7 +3,7 @@ """ from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi +from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi from datadog_api_client.v2.model.ci_app_query_options import CIAppQueryOptions from datadog_api_client.v2.model.ci_app_query_page_options import CIAppQueryPageOptions from datadog_api_client.v2.model.ci_app_sort import CIAppSort @@ -27,7 +27,7 @@ configuration = Configuration() with ApiClient(configuration) as api_client: - api_instance = CIVisibilityTestsApi(api_client) + api_instance = TestOptimizationApi(api_client) response = api_instance.search_ci_app_test_events(body=body) print(response) diff --git a/examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.py b/examples/v2/test-optimization/SearchCIAppTestEvents_1675695429.py similarity index 87% rename from examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.py rename to examples/v2/test-optimization/SearchCIAppTestEvents_1675695429.py index b0dd35065e..d297ece402 100644 --- a/examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.py +++ b/examples/v2/test-optimization/SearchCIAppTestEvents_1675695429.py @@ -3,7 +3,7 @@ """ from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi +from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi from datadog_api_client.v2.model.ci_app_query_page_options import CIAppQueryPageOptions from datadog_api_client.v2.model.ci_app_sort import CIAppSort from datadog_api_client.v2.model.ci_app_test_events_request import CIAppTestEventsRequest @@ -23,7 +23,7 @@ configuration = Configuration() with ApiClient(configuration) as api_client: - api_instance = CIVisibilityTestsApi(api_client) + api_instance = TestOptimizationApi(api_client) items = api_instance.search_ci_app_test_events_with_pagination(body=body) for item in items: print(item) diff --git a/src/datadog_api_client/v2/api/ci_visibility_tests_api.py b/src/datadog_api_client/v2/api/test_optimization_api.py similarity index 94% rename from src/datadog_api_client/v2/api/ci_visibility_tests_api.py rename to src/datadog_api_client/v2/api/test_optimization_api.py index 43ec1beee9..97e4ac4fcf 100644 --- a/src/datadog_api_client/v2/api/ci_visibility_tests_api.py +++ b/src/datadog_api_client/v2/api/test_optimization_api.py @@ -23,9 +23,9 @@ from datadog_api_client.v2.model.ci_app_test_events_request import CIAppTestEventsRequest -class CIVisibilityTestsApi: +class TestOptimizationApi: """ - Search or aggregate your CI Visibility test events over HTTP. See the `Test Visibility in Datadog page `_ for more information. + Search or aggregate your test events over HTTP. See the `Test Optimization in Datadog `_ page for more information. """ def __init__(self, api_client=None): @@ -128,7 +128,7 @@ def aggregate_ci_app_test_events( ) -> CIAppTestsAnalyticsAggregateResponse: """Aggregate tests events. - The API endpoint to aggregate CI Visibility test events into buckets of computed metrics and timeseries. + The API endpoint to aggregate test events into buckets of computed metrics and timeseries. :type body: CIAppTestsAggregateRequest :rtype: CIAppTestsAnalyticsAggregateResponse @@ -150,7 +150,7 @@ def list_ci_app_test_events( ) -> CIAppTestEventsResponse: """Get a list of tests events. - List endpoint returns CI Visibility test events that match a `search query `_. + List endpoint returns test events that match a `search query `_. `Results are paginated similarly to logs `_. Use this endpoint to see your latest test events. @@ -259,7 +259,7 @@ def search_ci_app_test_events( ) -> CIAppTestEventsResponse: """Search tests events. - List endpoint returns CI Visibility test events that match a `search query `_. + List endpoint returns test events that match a `search query `_. `Results are paginated similarly to logs `_. Use this endpoint to build complex events filtering and search. diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 7a5c1191e6..317e76e50e 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -8,7 +8,6 @@ from datadog_api_client.v2.api.audit_api import AuditApi from datadog_api_client.v2.api.authn_mappings_api import AuthNMappingsApi from datadog_api_client.v2.api.ci_visibility_pipelines_api import CIVisibilityPipelinesApi -from datadog_api_client.v2.api.ci_visibility_tests_api import CIVisibilityTestsApi from datadog_api_client.v2.api.csm_agents_api import CSMAgentsApi from datadog_api_client.v2.api.csm_coverage_analysis_api import CSMCoverageAnalysisApi from datadog_api_client.v2.api.csm_threats_api import CSMThreatsApi @@ -59,6 +58,7 @@ from datadog_api_client.v2.api.spans_metrics_api import SpansMetricsApi from datadog_api_client.v2.api.synthetics_api import SyntheticsApi from datadog_api_client.v2.api.teams_api import TeamsApi +from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi from datadog_api_client.v2.api.users_api import UsersApi from datadog_api_client.v2.api.workflow_automation_api import WorkflowAutomationApi @@ -75,7 +75,6 @@ "AuditApi", "AuthNMappingsApi", "CIVisibilityPipelinesApi", - "CIVisibilityTestsApi", "CSMAgentsApi", "CSMCoverageAnalysisApi", "CSMThreatsApi", @@ -126,6 +125,7 @@ "SpansMetricsApi", "SyntheticsApi", "TeamsApi", + "TestOptimizationApi", "UsageMeteringApi", "UsersApi", "WorkflowAutomationApi", diff --git a/src/datadog_api_client/v2/model/ci_app_event_attributes.py b/src/datadog_api_client/v2/model/ci_app_event_attributes.py index 681f748c01..83f77fa118 100644 --- a/src/datadog_api_client/v2/model/ci_app_event_attributes.py +++ b/src/datadog_api_client/v2/model/ci_app_event_attributes.py @@ -65,7 +65,7 @@ def __init__( """ JSON object containing all event attributes and their associated values. - :param attributes: JSON object of attributes from CI Visibility test events. + :param attributes: JSON object of attributes from Test Optimization test events. :type attributes: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional :param tags: Array of tags associated with your event. diff --git a/tests/v2/features/test_optimization.feature b/tests/v2/features/test_optimization.feature new file mode 100644 index 0000000000..529f60d3f6 --- /dev/null +++ b/tests/v2/features/test_optimization.feature @@ -0,0 +1,72 @@ +@endpoint(test-optimization) @endpoint(test-optimization-v2) +Feature: Test Optimization + Search or aggregate your test events over HTTP. See the [Test Optimization + in Datadog](https://docs.datadoghq.com/tests/) page for more information. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "TestOptimization" API + + @generated @skip @team:Datadog/ci-app-backend + Scenario: Aggregate tests events returns "Bad Request" response + Given new "AggregateCIAppTestEvents" request + 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"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/ci-app-backend + Scenario: Aggregate tests events returns "OK" response + Given new "AggregateCIAppTestEvents" request + 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"}} + When the request is sent + Then the response status is 200 OK + And the response "meta.status" is equal to "done" + + @generated @skip @team:Datadog/ci-app-backend + Scenario: Get a list of tests events returns "Bad Request" response + Given new "ListCIAppTestEvents" request + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/ci-app-backend + Scenario: Get a list of tests events returns "OK" response + Given new "ListCIAppTestEvents" request + And request contains "filter[query]" parameter with value "@test.service:web-ui-tests" + And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}" + And request contains "filter[to]" parameter with value "{{ timeISO('now') }}" + And request contains "page[limit]" parameter with value 5 + When the request is sent + Then the response status is 200 OK + + @replay-only @skip-validation @team:Datadog/ci-app-backend @with-pagination + Scenario: Get a list of tests events returns "OK" response with pagination + Given new "ListCIAppTestEvents" request + And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}" + And request contains "filter[to]" parameter with value "{{ timeISO('now') }}" + And request contains "page[limit]" parameter with value 2 + When the request with pagination is sent + Then the response status is 200 OK + And the response has 2 items + + @generated @skip @team:Datadog/ci-app-backend + Scenario: Search tests events returns "Bad Request" response + Given new "SearchCIAppTestEvents" request + 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"} + When the request is sent + Then the response status is 400 Bad Request + + @team:Datadog/ci-app-backend + Scenario: Search tests events returns "OK" response + Given new "SearchCIAppTestEvents" request + 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"} + When the request is sent + Then the response status is 200 OK + + @replay-only @skip-validation @team:Datadog/ci-app-backend @with-pagination + Scenario: Search tests events returns "OK" response with pagination + Given new "SearchCIAppTestEvents" request + And body with value {"filter": {"from": "now-15m", "query": "@test.status:pass AND -@language:python", "to": "now"}, "page": {"limit": 2}, "sort": "timestamp"} + When the request with pagination is sent + Then the response status is 200 OK + And the response has 2 items diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 288ca835fe..68313e321c 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -453,19 +453,19 @@ } }, "AggregateCIAppTestEvents": { - "tag": "CI Visibility Tests", + "tag": "Test Optimization", "undo": { "type": "safe" } }, "ListCIAppTestEvents": { - "tag": "CI Visibility Tests", + "tag": "Test Optimization", "undo": { "type": "safe" } }, "SearchCIAppTestEvents": { - "tag": "CI Visibility Tests", + "tag": "Test Optimization", "undo": { "type": "safe" }