-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathSearchFlakyTests.ts
More file actions
38 lines (34 loc) · 1.03 KB
/
SearchFlakyTests.ts
File metadata and controls
38 lines (34 loc) · 1.03 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
28
29
30
31
32
33
34
35
36
37
38
/**
* Search flaky tests returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
configuration.unstableOperations["v2.searchFlakyTests"] = true;
const apiInstance = new v2.TestOptimizationApi(configuration);
const params: v2.TestOptimizationApiSearchFlakyTestsRequest = {
body: {
data: {
attributes: {
filter: {
includeHistory: true,
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",
},
},
};
apiInstance
.searchFlakyTests(params)
.then((data: v2.FlakyTestsSearchResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));