From fa28c68679f0a57c7667bd576ab5b11c8dbdb686 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 4 Feb 2026 14:28:37 +0000 Subject: [PATCH] Regenerate client from commit 7923551 of spec repo --- .generator/schemas/v2/openapi.yaml | 77 ++++++- .../test-optimization/SearchFlakyTests.java | 1 + .../SearchFlakyTests_1224086727.java | 1 + .../SearchFlakyTests_209064879.java | 51 +++++ .../client/v2/api/TestOptimizationApi.java | 12 ++ .../client/v2/model/FlakyTestAttributes.java | 42 ++++ .../api/client/v2/model/FlakyTestHistory.java | 202 ++++++++++++++++++ .../FlakyTestsSearchRequestAttributes.java | 31 ++- .../client/v2/api/test_optimization.feature | 18 +- 9 files changed, 430 insertions(+), 5 deletions(-) create mode 100644 examples/v2/test-optimization/SearchFlakyTests_209064879.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/FlakyTestHistory.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a8908359f48..05036163ee8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -24021,6 +24021,22 @@ components: type: string flaky_state: $ref: '#/components/schemas/FlakyTestAttributesFlakyState' + history: + description: 'Chronological history of status changes for this flaky test, + ordered from most recent to oldest. + + Includes state transitions like new -> quarantined -> fixed, along with + the associated commit SHA when available.' + example: + - commit_sha: abc123def456 + status: quarantined + timestamp: 1704067200000 + - commit_sha: '' + status: new + timestamp: 1703980800000 + items: + $ref: '#/components/schemas/FlakyTestHistory' + type: array last_flaked_branch: description: The branch name where the test exhibited flakiness for the last time. @@ -24105,6 +24121,29 @@ components: - FIXED - QUARANTINED - DISABLED + FlakyTestHistory: + description: A single history entry representing a status change for a flaky + test. + properties: + commit_sha: + description: The commit SHA associated with this status change. Will be + an empty string if the commit SHA is not available. + example: abc123def456 + type: string + status: + description: The test status at this point in history. + example: quarantined + type: string + timestamp: + description: Unix timestamp in milliseconds when this status change occurred. + example: 1704067200000 + format: int64 + type: integer + required: + - status + - commit_sha + - timestamp + type: object FlakyTestPipelineStats: description: CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from @@ -24251,6 +24290,17 @@ components: properties: filter: $ref: '#/components/schemas/FlakyTestsSearchFilter' + include_history: + default: false + description: 'Whether to include the status change history for each flaky + test in the response. + + When set to true, each test will include a `history` array with chronological + status changes. + + Defaults to false.' + example: true + type: boolean page: $ref: '#/components/schemas/FlakyTestsSearchPageOptions' sort: @@ -100677,8 +100727,33 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: - description: List endpoint returning flaky tests from Flaky Test Management. + description: 'List endpoint returning flaky tests from Flaky Test Management. Results are paginated. + + + The response includes comprehensive test information including: + + - Test identification and metadata (module, suite, name) + + - Flaky state and categorization + + - First and last flake occurrences (timestamp, branch, commit SHA) + + - Test execution statistics from the last 7 days (failure rate) + + - Pipeline impact metrics (failed pipelines count, total lost time) + + - Complete status change history (optional, ordered from most recent to oldest) + + + Set `include_history` to `true` in the request to receive the status change + history for each test. + + History is disabled by default for better performance. + + + Results support filtering by various facets including service, environment, + repository, branch, and test state.' operationId: SearchFlakyTests requestBody: content: diff --git a/examples/v2/test-optimization/SearchFlakyTests.java b/examples/v2/test-optimization/SearchFlakyTests.java index bd908ce88e3..58650a27895 100644 --- a/examples/v2/test-optimization/SearchFlakyTests.java +++ b/examples/v2/test-optimization/SearchFlakyTests.java @@ -31,6 +31,7 @@ public static void main(String[] args) { """ flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist" """)) + .includeHistory(true) .page( new FlakyTestsSearchPageOptions() .cursor( diff --git a/examples/v2/test-optimization/SearchFlakyTests_1224086727.java b/examples/v2/test-optimization/SearchFlakyTests_1224086727.java index 7c851377965..164ee6fe99f 100644 --- a/examples/v2/test-optimization/SearchFlakyTests_1224086727.java +++ b/examples/v2/test-optimization/SearchFlakyTests_1224086727.java @@ -31,6 +31,7 @@ public static void main(String[] args) { """ flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist" """)) + .includeHistory(true) .page( new FlakyTestsSearchPageOptions() .cursor( diff --git a/examples/v2/test-optimization/SearchFlakyTests_209064879.java b/examples/v2/test-optimization/SearchFlakyTests_209064879.java new file mode 100644 index 00000000000..f1b3d1462bc --- /dev/null +++ b/examples/v2/test-optimization/SearchFlakyTests_209064879.java @@ -0,0 +1,51 @@ +// Search flaky tests returns "OK" response with history + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TestOptimizationApi; +import com.datadog.api.client.v2.api.TestOptimizationApi.SearchFlakyTestsOptionalParameters; +import com.datadog.api.client.v2.model.FlakyTestsSearchFilter; +import com.datadog.api.client.v2.model.FlakyTestsSearchPageOptions; +import com.datadog.api.client.v2.model.FlakyTestsSearchRequest; +import com.datadog.api.client.v2.model.FlakyTestsSearchRequestAttributes; +import com.datadog.api.client.v2.model.FlakyTestsSearchRequestData; +import com.datadog.api.client.v2.model.FlakyTestsSearchRequestDataType; +import com.datadog.api.client.v2.model.FlakyTestsSearchResponse; +import com.datadog.api.client.v2.model.FlakyTestsSearchSort; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.searchFlakyTests", true); + TestOptimizationApi apiInstance = new TestOptimizationApi(defaultClient); + + FlakyTestsSearchRequest body = + new FlakyTestsSearchRequest() + .data( + new FlakyTestsSearchRequestData() + .attributes( + new FlakyTestsSearchRequestAttributes() + .filter( + new FlakyTestsSearchFilter() + .query( + """ +flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist" +""")) + .page(new FlakyTestsSearchPageOptions().limit(10L)) + .sort(FlakyTestsSearchSort.FQN_ASCENDING) + .includeHistory(true)) + .type(FlakyTestsSearchRequestDataType.SEARCH_FLAKY_TESTS_REQUEST)); + + try { + FlakyTestsSearchResponse result = + apiInstance.searchFlakyTests(new SearchFlakyTestsOptionalParameters().body(body)); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TestOptimizationApi#searchFlakyTests"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java b/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java index 9cbe934357a..02e6e7a08f4 100644 --- a/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java @@ -197,6 +197,18 @@ public PaginationIterable searchFlakyTestsWithPagination( /** * List endpoint returning flaky tests from Flaky Test Management. Results are paginated. * + *

The response includes comprehensive test information including: - Test identification and + * metadata (module, suite, name) - Flaky state and categorization - First and last flake + * occurrences (timestamp, branch, commit SHA) - Test execution statistics from the last 7 days + * (failure rate) - Pipeline impact metrics (failed pipelines count, total lost time) - Complete + * status change history (optional, ordered from most recent to oldest) + * + *

Set include_history to true in the request to receive the status + * change history for each test. History is disabled by default for better performance. + * + *

Results support filtering by various facets including service, environment, repository, + * branch, and test state. + * * @param parameters Optional parameters for the request. * @return ApiResponse<FlakyTestsSearchResponse> * @throws ApiException if fails to make API call diff --git a/src/main/java/com/datadog/api/client/v2/model/FlakyTestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FlakyTestAttributes.java index 18296e02107..5989264cb10 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FlakyTestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/FlakyTestAttributes.java @@ -29,6 +29,7 @@ FlakyTestAttributes.JSON_PROPERTY_FIRST_FLAKED_TS, FlakyTestAttributes.JSON_PROPERTY_FLAKY_CATEGORY, FlakyTestAttributes.JSON_PROPERTY_FLAKY_STATE, + FlakyTestAttributes.JSON_PROPERTY_HISTORY, FlakyTestAttributes.JSON_PROPERTY_LAST_FLAKED_BRANCH, FlakyTestAttributes.JSON_PROPERTY_LAST_FLAKED_SHA, FlakyTestAttributes.JSON_PROPERTY_LAST_FLAKED_TS, @@ -68,6 +69,9 @@ public class FlakyTestAttributes { public static final String JSON_PROPERTY_FLAKY_STATE = "flaky_state"; private FlakyTestAttributesFlakyState flakyState; + public static final String JSON_PROPERTY_HISTORY = "history"; + private List history = null; + public static final String JSON_PROPERTY_LAST_FLAKED_BRANCH = "last_flaked_branch"; private String lastFlakedBranch; @@ -302,6 +306,41 @@ public void setFlakyState(FlakyTestAttributesFlakyState flakyState) { this.flakyState = flakyState; } + public FlakyTestAttributes history(List history) { + this.history = history; + for (FlakyTestHistory item : history) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FlakyTestAttributes addHistoryItem(FlakyTestHistory historyItem) { + if (this.history == null) { + this.history = new ArrayList<>(); + } + this.history.add(historyItem); + this.unparsed |= historyItem.unparsed; + return this; + } + + /** + * Chronological history of status changes for this flaky test, ordered from most recent to + * oldest. Includes state transitions like new -> quarantined -> fixed, along with the + * associated commit SHA when available. + * + * @return history + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HISTORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getHistory() { + return history; + } + + public void setHistory(List history) { + this.history = history; + } + public FlakyTestAttributes lastFlakedBranch(String lastFlakedBranch) { this.lastFlakedBranch = lastFlakedBranch; return this; @@ -611,6 +650,7 @@ public boolean equals(Object o) { && Objects.equals(this.firstFlakedTs, flakyTestAttributes.firstFlakedTs) && Objects.equals(this.flakyCategory, flakyTestAttributes.flakyCategory) && Objects.equals(this.flakyState, flakyTestAttributes.flakyState) + && Objects.equals(this.history, flakyTestAttributes.history) && Objects.equals(this.lastFlakedBranch, flakyTestAttributes.lastFlakedBranch) && Objects.equals(this.lastFlakedSha, flakyTestAttributes.lastFlakedSha) && Objects.equals(this.lastFlakedTs, flakyTestAttributes.lastFlakedTs) @@ -635,6 +675,7 @@ public int hashCode() { firstFlakedTs, flakyCategory, flakyState, + history, lastFlakedBranch, lastFlakedSha, lastFlakedTs, @@ -660,6 +701,7 @@ public String toString() { sb.append(" firstFlakedTs: ").append(toIndentedString(firstFlakedTs)).append("\n"); sb.append(" flakyCategory: ").append(toIndentedString(flakyCategory)).append("\n"); sb.append(" flakyState: ").append(toIndentedString(flakyState)).append("\n"); + sb.append(" history: ").append(toIndentedString(history)).append("\n"); sb.append(" lastFlakedBranch: ").append(toIndentedString(lastFlakedBranch)).append("\n"); sb.append(" lastFlakedSha: ").append(toIndentedString(lastFlakedSha)).append("\n"); sb.append(" lastFlakedTs: ").append(toIndentedString(lastFlakedTs)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/FlakyTestHistory.java b/src/main/java/com/datadog/api/client/v2/model/FlakyTestHistory.java new file mode 100644 index 00000000000..e99e13440fa --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FlakyTestHistory.java @@ -0,0 +1,202 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A single history entry representing a status change for a flaky test. */ +@JsonPropertyOrder({ + FlakyTestHistory.JSON_PROPERTY_COMMIT_SHA, + FlakyTestHistory.JSON_PROPERTY_STATUS, + FlakyTestHistory.JSON_PROPERTY_TIMESTAMP +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FlakyTestHistory { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMMIT_SHA = "commit_sha"; + private String commitSha; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + private Long timestamp; + + public FlakyTestHistory() {} + + @JsonCreator + public FlakyTestHistory( + @JsonProperty(required = true, value = JSON_PROPERTY_COMMIT_SHA) String commitSha, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMESTAMP) Long timestamp) { + this.commitSha = commitSha; + this.status = status; + this.timestamp = timestamp; + } + + public FlakyTestHistory commitSha(String commitSha) { + this.commitSha = commitSha; + return this; + } + + /** + * The commit SHA associated with this status change. Will be an empty string if the commit SHA is + * not available. + * + * @return commitSha + */ + @JsonProperty(JSON_PROPERTY_COMMIT_SHA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCommitSha() { + return commitSha; + } + + public void setCommitSha(String commitSha) { + this.commitSha = commitSha; + } + + public FlakyTestHistory status(String status) { + this.status = status; + return this; + } + + /** + * The test status at this point in history. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public FlakyTestHistory timestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Unix timestamp in milliseconds when this status change occurred. + * + * @return timestamp + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(Long timestamp) { + this.timestamp = timestamp; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FlakyTestHistory + */ + @JsonAnySetter + public FlakyTestHistory putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FlakyTestHistory object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FlakyTestHistory flakyTestHistory = (FlakyTestHistory) o; + return Objects.equals(this.commitSha, flakyTestHistory.commitSha) + && Objects.equals(this.status, flakyTestHistory.status) + && Objects.equals(this.timestamp, flakyTestHistory.timestamp) + && Objects.equals(this.additionalProperties, flakyTestHistory.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(commitSha, status, timestamp, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FlakyTestHistory {\n"); + sb.append(" commitSha: ").append(toIndentedString(commitSha)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchRequestAttributes.java index eb6799104de..b8c4e04d22e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/FlakyTestsSearchRequestAttributes.java @@ -19,6 +19,7 @@ /** Attributes for the flaky tests search request. */ @JsonPropertyOrder({ FlakyTestsSearchRequestAttributes.JSON_PROPERTY_FILTER, + FlakyTestsSearchRequestAttributes.JSON_PROPERTY_INCLUDE_HISTORY, FlakyTestsSearchRequestAttributes.JSON_PROPERTY_PAGE, FlakyTestsSearchRequestAttributes.JSON_PROPERTY_SORT }) @@ -29,6 +30,9 @@ public class FlakyTestsSearchRequestAttributes { public static final String JSON_PROPERTY_FILTER = "filter"; private FlakyTestsSearchFilter filter; + public static final String JSON_PROPERTY_INCLUDE_HISTORY = "include_history"; + private Boolean includeHistory = false; + public static final String JSON_PROPERTY_PAGE = "page"; private FlakyTestsSearchPageOptions page; @@ -57,6 +61,29 @@ public void setFilter(FlakyTestsSearchFilter filter) { this.filter = filter; } + public FlakyTestsSearchRequestAttributes includeHistory(Boolean includeHistory) { + this.includeHistory = includeHistory; + return this; + } + + /** + * Whether to include the status change history for each flaky test in the response. When set to + * true, each test will include a history array with chronological status changes. + * Defaults to false. + * + * @return includeHistory + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDE_HISTORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeHistory() { + return includeHistory; + } + + public void setIncludeHistory(Boolean includeHistory) { + this.includeHistory = includeHistory; + } + public FlakyTestsSearchRequestAttributes page(FlakyTestsSearchPageOptions page) { this.page = page; this.unparsed |= page.unparsed; @@ -163,6 +190,7 @@ public boolean equals(Object o) { FlakyTestsSearchRequestAttributes flakyTestsSearchRequestAttributes = (FlakyTestsSearchRequestAttributes) o; return Objects.equals(this.filter, flakyTestsSearchRequestAttributes.filter) + && Objects.equals(this.includeHistory, flakyTestsSearchRequestAttributes.includeHistory) && Objects.equals(this.page, flakyTestsSearchRequestAttributes.page) && Objects.equals(this.sort, flakyTestsSearchRequestAttributes.sort) && Objects.equals( @@ -171,7 +199,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(filter, page, sort, additionalProperties); + return Objects.hash(filter, includeHistory, page, sort, additionalProperties); } @Override @@ -179,6 +207,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FlakyTestsSearchRequestAttributes {\n"); sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); + sb.append(" includeHistory: ").append(toIndentedString(includeHistory)).append("\n"); sb.append(" page: ").append(toIndentedString(page)).append("\n"); sb.append(" sort: ").append(toIndentedString(sort)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature b/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature index d21278d7646..bbf7d87075e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature @@ -13,7 +13,7 @@ Feature: Test Optimization Scenario: Search flaky tests returns "Bad Request" response Given operation "SearchFlakyTests" enabled And new "SearchFlakyTests" request - And 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"}} + And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} When the request is sent Then the response status is 400 Bad Request @@ -29,7 +29,7 @@ Feature: Test Optimization Scenario: Search flaky tests returns "OK" response Given operation "SearchFlakyTests" enabled And new "SearchFlakyTests" request - And 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"}} + And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} When the request is sent Then the response status is 200 OK @@ -41,11 +41,23 @@ Feature: Test Optimization When the request with pagination is sent Then the response status is 200 OK + @skip @team:DataDog/ci-app-backend + Scenario: Search flaky tests returns "OK" response with history + Given operation "SearchFlakyTests" enabled + And new "SearchFlakyTests" request + And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "page": {"limit": 10}, "sort": "fqn", "include_history": true}, "type": "search_flaky_tests_request"}} + When the request is sent + Then the response status is 200 OK + And the response "data[0].attributes" has field "history" + And the response "data[0].attributes.history[0]" has field "status" + And the response "data[0].attributes.history[0]" has field "commit_sha" + And the response "data[0].attributes.history[0]" has field "timestamp" + @generated @skip @team:DataDog/ci-app-backend @with-pagination Scenario: Search flaky tests returns "OK" response with pagination Given operation "SearchFlakyTests" enabled And new "SearchFlakyTests" request - And 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"}} + And body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""}, "include_history": true, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "failure_rate"}, "type": "search_flaky_tests_request"}} When the request with pagination is sent Then the response status is 200 OK