-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathSearchFlakyTests.rb
More file actions
27 lines (25 loc) · 1.05 KB
/
SearchFlakyTests.rb
File metadata and controls
27 lines (25 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Search flaky tests returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.search_flaky_tests".to_sym] = true
end
api_instance = DatadogAPIClient::V2::TestOptimizationAPI.new
body = DatadogAPIClient::V2::FlakyTestsSearchRequest.new({
data: DatadogAPIClient::V2::FlakyTestsSearchRequestData.new({
attributes: DatadogAPIClient::V2::FlakyTestsSearchRequestAttributes.new({
filter: DatadogAPIClient::V2::FlakyTestsSearchFilter.new({
query: 'flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"',
}),
page: DatadogAPIClient::V2::FlakyTestsSearchPageOptions.new({
cursor: "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==",
limit: 25,
}),
sort: DatadogAPIClient::V2::FlakyTestsSearchSort::FAILURE_RATE_ASCENDING,
}),
type: DatadogAPIClient::V2::FlakyTestsSearchRequestDataType::SEARCH_FLAKY_TESTS_REQUEST,
}),
})
opts = {
body: body,
}
p api_instance.search_flaky_tests(opts)