-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathUpdateFlakyTestsManagementPolicies.ts
More file actions
74 lines (70 loc) · 2.03 KB
/
UpdateFlakyTestsManagementPolicies.ts
File metadata and controls
74 lines (70 loc) · 2.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* Update Flaky Tests Management policies returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateFlakyTestsManagementPolicies"] =
true;
const apiInstance = new v2.TestOptimizationApi(configuration);
const params: v2.TestOptimizationApiUpdateFlakyTestsManagementPoliciesRequest =
{
body: {
data: {
attributes: {
attemptToFix: {
retries: 3,
},
disabled: {
autoDisableRule: {
enabled: false,
status: "active",
windowSeconds: 3600,
},
branchRule: {
branches: ["main"],
enabled: true,
excludedBranches: [],
excludedTestServices: [],
},
enabled: false,
failureRateRule: {
branches: [],
enabled: false,
minRuns: 10,
status: "active",
threshold: 0.5,
},
},
quarantined: {
autoQuarantineRule: {
enabled: true,
windowSeconds: 3600,
},
branchRule: {
branches: ["main"],
enabled: true,
excludedBranches: [],
excludedTestServices: [],
},
enabled: true,
failureRateRule: {
branches: ["main"],
enabled: true,
minRuns: 10,
threshold: 0.5,
},
},
repositoryId: "github.com/datadog/shopist",
},
type: "test_optimization_update_flaky_tests_management_policies_request",
},
},
};
apiInstance
.updateFlakyTestsManagementPolicies(params)
.then((data: v2.TestOptimizationFlakyTestsManagementPoliciesResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));