Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 1 addition & 76 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24023,22 +24023,6 @@ 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.
Expand Down Expand Up @@ -24123,29 +24107,6 @@ 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
Expand Down Expand Up @@ -24292,17 +24253,6 @@ 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:
Expand Down Expand Up @@ -101135,33 +101085,8 @@ 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:
Expand Down
1 change: 0 additions & 1 deletion examples/v2/test-optimization/SearchFlakyTests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
filter: DatadogAPIClient::V2::FlakyTestsSearchFilter.new({
query: 'flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"',
}),
include_history: true,
page: DatadogAPIClient::V2::FlakyTestsSearchPageOptions.new({
cursor: "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==",
limit: 25,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
filter: DatadogAPIClient::V2::FlakyTestsSearchFilter.new({
query: 'flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"',
}),
include_history: true,
page: DatadogAPIClient::V2::FlakyTestsSearchPageOptions.new({
cursor: "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==",
limit: 25,
Expand Down
27 changes: 0 additions & 27 deletions examples/v2/test-optimization/SearchFlakyTests_209064879.rb

This file was deleted.

18 changes: 3 additions & 15 deletions features/v2/test_optimization.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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\""}, "include_history": true, "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\""}, "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

Expand All @@ -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\""}, "include_history": true, "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\""}, "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

Expand All @@ -41,23 +41,11 @@ 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\""}, "include_history": true, "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\""}, "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

Expand Down
1 change: 0 additions & 1 deletion lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,6 @@ def overrides
"v2.flaky_test" => "FlakyTest",
"v2.flaky_test_attributes" => "FlakyTestAttributes",
"v2.flaky_test_attributes_flaky_state" => "FlakyTestAttributesFlakyState",
"v2.flaky_test_history" => "FlakyTestHistory",
"v2.flaky_test_pipeline_stats" => "FlakyTestPipelineStats",
"v2.flaky_test_run_metadata" => "FlakyTestRunMetadata",
"v2.flaky_tests_pagination" => "FlakyTestsPagination",
Expand Down
13 changes: 0 additions & 13 deletions lib/datadog_api_client/v2/api/test_optimization_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,6 @@ def search_flaky_tests(opts = {})
#
# 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 opts [Hash] the optional parameters
# @option opts [FlakyTestsSearchRequest] :body
# @return [Array<(FlakyTestsSearchResponse, Integer, Hash)>] FlakyTestsSearchResponse data, response status code and response headers
Expand Down
15 changes: 1 addition & 14 deletions lib/datadog_api_client/v2/models/flaky_test_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ class FlakyTestAttributes
# The current state of the flaky test.
attr_accessor :flaky_state

# 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.
attr_accessor :history

# The branch name where the test exhibited flakiness for the last time.
attr_accessor :last_flaked_branch

Expand Down Expand Up @@ -104,7 +100,6 @@ def self.attribute_map
:'first_flaked_ts' => :'first_flaked_ts',
:'flaky_category' => :'flaky_category',
:'flaky_state' => :'flaky_state',
:'history' => :'history',
:'last_flaked_branch' => :'last_flaked_branch',
:'last_flaked_sha' => :'last_flaked_sha',
:'last_flaked_ts' => :'last_flaked_ts',
Expand All @@ -130,7 +125,6 @@ def self.openapi_types
:'first_flaked_ts' => :'Integer',
:'flaky_category' => :'String',
:'flaky_state' => :'FlakyTestAttributesFlakyState',
:'history' => :'Array<FlakyTestHistory>',
:'last_flaked_branch' => :'String',
:'last_flaked_sha' => :'String',
:'last_flaked_ts' => :'Integer',
Expand Down Expand Up @@ -207,12 +201,6 @@ def initialize(attributes = {})
self.flaky_state = attributes[:'flaky_state']
end

if attributes.key?(:'history')
if (value = attributes[:'history']).is_a?(Array)
self.history = value
end
end

if attributes.key?(:'last_flaked_branch')
self.last_flaked_branch = attributes[:'last_flaked_branch']
end
Expand Down Expand Up @@ -290,7 +278,6 @@ def ==(o)
first_flaked_ts == o.first_flaked_ts &&
flaky_category == o.flaky_category &&
flaky_state == o.flaky_state &&
history == o.history &&
last_flaked_branch == o.last_flaked_branch &&
last_flaked_sha == o.last_flaked_sha &&
last_flaked_ts == o.last_flaked_ts &&
Expand All @@ -308,7 +295,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[attempt_to_fix_id, codeowners, envs, first_flaked_branch, first_flaked_sha, first_flaked_ts, flaky_category, flaky_state, history, last_flaked_branch, last_flaked_sha, last_flaked_ts, _module, name, pipeline_stats, services, suite, test_run_metadata, test_stats, additional_properties].hash
[attempt_to_fix_id, codeowners, envs, first_flaked_branch, first_flaked_sha, first_flaked_ts, flaky_category, flaky_state, last_flaked_branch, last_flaked_sha, last_flaked_ts, _module, name, pipeline_stats, services, suite, test_run_metadata, test_stats, additional_properties].hash
end
end
end
Loading
Loading