Skip to content

Commit 660164d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0979df0 of spec repo
1 parent 2e6b2d7 commit 660164d

28 files changed

+1946
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 419 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Search flaky tests returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.searchFlakyTests"] = true;
9+
const apiInstance = new v2.TestOptimizationApi(configuration);
10+
11+
const params: v2.TestOptimizationApiSearchFlakyTestsRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
filter: {
16+
query: `flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"`,
17+
},
18+
page: {
19+
cursor:
20+
"eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==",
21+
limit: 25,
22+
},
23+
sort: "failure_rate",
24+
},
25+
type: "search_flaky_tests_request",
26+
},
27+
},
28+
};
29+
30+
apiInstance
31+
.searchFlakyTests(params)
32+
.then((data: v2.FlakyTestsSearchResponse) => {
33+
console.log(
34+
"API called successfully. Returned data: " + JSON.stringify(data)
35+
);
36+
})
37+
.catch((error: any) => console.error(error));
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Search flaky tests returns "OK" response with pagination
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.searchFlakyTests"] = true;
9+
const apiInstance = new v2.TestOptimizationApi(configuration);
10+
11+
const params: v2.TestOptimizationApiSearchFlakyTestsRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
filter: {
16+
query: `flaky_test_state:active @git.repository.id_v2:"github.com/datadog/shopist"`,
17+
},
18+
page: {
19+
cursor:
20+
"eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==",
21+
limit: 25,
22+
},
23+
sort: "failure_rate",
24+
},
25+
type: "search_flaky_tests_request",
26+
},
27+
},
28+
};
29+
30+
(async () => {
31+
try {
32+
for await (const item of apiInstance.searchFlakyTestsWithPagination(
33+
params
34+
)) {
35+
console.log(item);
36+
}
37+
} catch (error) {
38+
console.error(error);
39+
}
40+
})();
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Search flaky tests returns "OK" response with filtered query
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.searchFlakyTests"] = true;
9+
const apiInstance = new v2.TestOptimizationApi(configuration);
10+
11+
const params: v2.TestOptimizationApiSearchFlakyTestsRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
filter: {
16+
query: `flaky_test_state:active @git.repository.id_v2:"github.com/datadog/cart-tracking"`,
17+
},
18+
page: {
19+
limit: 10,
20+
},
21+
sort: "-last_flaked",
22+
},
23+
type: "search_flaky_tests_request",
24+
},
25+
},
26+
};
27+
28+
(async () => {
29+
try {
30+
for await (const item of apiInstance.searchFlakyTestsWithPagination(
31+
params
32+
)) {
33+
console.log(item);
34+
}
35+
} catch (error) {
36+
console.error(error);
37+
}
38+
})();

features/support/scenarios_model_mapping.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8413,6 +8413,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
84138413
},
84148414
"operationResponseType": "IncidentTeamResponse",
84158415
},
8416+
"v2.SearchFlakyTests": {
8417+
"body": {
8418+
"type": "FlakyTestsSearchRequest",
8419+
"format": "",
8420+
},
8421+
"operationResponseType": "FlakyTestsSearchResponse",
8422+
},
84168423
"v2.SendInvitations": {
84178424
"body": {
84188425
"type": "UserInvitationsRequest",
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@endpoint(test-optimization) @endpoint(test-optimization-v2)
2+
Feature: Test Optimization
3+
Search and manage flaky tests through Test Optimization. See the [Test
4+
Optimization page](https://docs.datadoghq.com/tests/) for more
5+
information.
6+
7+
Background:
8+
Given a valid "apiKeyAuth" key in the system
9+
And a valid "appKeyAuth" key in the system
10+
And an instance of "TestOptimization" API
11+
And operation "SearchFlakyTests" enabled
12+
And new "SearchFlakyTests" request
13+
14+
@generated @skip @team:DataDog/ci-app-backend
15+
Scenario: Search flaky tests returns "Bad Request" response
16+
Given 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"}}
17+
When the request is sent
18+
Then the response status is 400 Bad Request
19+
20+
@skip @team:DataDog/ci-app-backend
21+
Scenario: Search flaky tests returns "Bad Request" response with invalid limit
22+
Given body with value {"data": {"attributes": {"filter": {"query": "*"}, "page": {"limit": 2000}, "sort": "fqn"}, "type": "search_flaky_tests_request"}}
23+
When the request is sent
24+
Then the response status is 400 Bad Request
25+
26+
@generated @skip @team:DataDog/ci-app-backend
27+
Scenario: Search flaky tests returns "OK" response
28+
Given 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"}}
29+
When the request is sent
30+
Then the response status is 200 OK
31+
32+
@replay-only @skip @skip-validation @team:DataDog/ci-app-backend @with-pagination
33+
Scenario: Search flaky tests returns "OK" response with filtered query
34+
Given body with value {"data": {"attributes": {"filter": {"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/cart-tracking\""}, "page": {"limit": 10}, "sort": "-last_flaked"}, "type": "search_flaky_tests_request"}}
35+
When the request with pagination is sent
36+
Then the response status is 200 OK
37+
38+
@generated @skip @team:DataDog/ci-app-backend @with-pagination
39+
Scenario: Search flaky tests returns "OK" response with pagination
40+
Given 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"}}
41+
When the request with pagination is sent
42+
Then the response status is 200 OK

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3966,6 +3966,12 @@
39663966
"type": "idempotent"
39673967
}
39683968
},
3969+
"SearchFlakyTests": {
3970+
"tag": "Test Optimization",
3971+
"undo": {
3972+
"type": "safe"
3973+
}
3974+
},
39693975
"GetUsageApplicationSecurityMonitoring": {
39703976
"tag": "Usage Metering",
39713977
"undo": {

packages/datadog-api-client-common/configuration.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ export function createConfiguration(
327327
"v2.getIncidentTeam": false,
328328
"v2.listIncidentTeams": false,
329329
"v2.updateIncidentTeam": false,
330+
"v2.searchFlakyTests": false,
330331
}
331332
);
332333
configuration.httpApi.zstdCompressorCallback = conf.zstdCompressorCallback;

0 commit comments

Comments
 (0)