Skip to content

Commit 30465ad

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Add extractedValuesFromScript to multistep API tests (#2069)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 2e9a78f commit 30465ad

File tree

15 files changed

+106
-91
lines changed

15 files changed

+106
-91
lines changed

Diff for: .apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-02-27 13:36:47.723889",
8-
"spec_repo_commit": "91ac2533"
7+
"regenerated": "2025-02-27 14:00:44.283754",
8+
"spec_repo_commit": "240ec82d"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-27 13:36:47.739616",
13-
"spec_repo_commit": "91ac2533"
12+
"regenerated": "2025-02-27 14:00:44.299331",
13+
"spec_repo_commit": "240ec82d"
1414
}
1515
}
1616
}

Diff for: .generator/schemas/v1/openapi.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -14028,6 +14028,9 @@ components:
1402814028
items:
1402914029
$ref: '#/components/schemas/SyntheticsParsingOptions'
1403014030
type: array
14031+
extractedValuesFromScript:
14032+
description: Generate variables using JavaScript.
14033+
type: string
1403114034
isCritical:
1403214035
description: 'Determines whether or not to consider the entire test as failed
1403314036
if this step fails.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2024-12-09T11:17:37.828Z"
1+
"2025-02-25T16:34:23.928Z"

Diff for: cassettes/v1/Synthetics_2658572017/Create-a-FIDO-global-variable-returns-OK-response_3226312717/recording.har

+22-22
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2024-12-09T11:17:40.840Z"
1+
"2025-02-25T16:34:26.775Z"

Diff for: cassettes/v1/Synthetics_2658572017/Create-a-TOTP-global-variable-returns-OK-response_1775224512/recording.har

+22-22
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2024-12-09T11:17:49.290Z"
1+
"2025-02-25T16:34:29.813Z"

Diff for: cassettes/v1/Synthetics_2658572017/Create-a-global-variable-from-test-returns-OK-response_2967481205/recording.har

+24-24
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2024-12-09T11:18:10.113Z"
1+
"2025-02-25T16:34:32.557Z"

Diff for: cassettes/v1/Synthetics_2658572017/Create-an-API-test-with-multi-subtype-returns-OK-Returns-the-created-test-details-response_460745598/recording.har

+13-13
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
},
99
"entries": [
1010
{
11-
"_id": "535fb990b04c7b683de669f5f053ca32",
11+
"_id": "d731b8f1382058e3effe601840175ccc",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
15-
"bodySize": 2310,
15+
"bodySize": 2396,
1616
"cookies": [],
1717
"headers": [
1818
{
@@ -32,17 +32,17 @@
3232
"postData": {
3333
"mimeType": "application/json",
3434
"params": [],
35-
"text": "{\"config\":{\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"steps\":[{\"allowFailure\":true,\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"exitIfSucceed\":true,\"extractedValues\":[{\"field\":\"server\",\"name\":\"EXTRACTED_VALUE\",\"parser\":{\"type\":\"raw\"},\"secure\":true,\"type\":\"http_header\"}],\"isCritical\":true,\"name\":\"request is sent\",\"request\":{\"httpVersion\":\"http2\",\"method\":\"GET\",\"timeout\":10,\"url\":\"https://datadoghq.com\"},\"retry\":{\"count\":5,\"interval\":1000},\"subtype\":\"http\"},{\"name\":\"Wait\",\"subtype\":\"wait\",\"value\":1},{\"allowFailure\":false,\"assertions\":[{\"operator\":\"lessThan\",\"target\":1000,\"type\":\"responseTime\"}],\"extractedValues\":[],\"isCritical\":true,\"name\":\"GRPC CALL\",\"request\":{\"callType\":\"unary\",\"compressedJsonDescriptor\":\"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==\",\"host\":\"grpcbin.test.k6.io\",\"message\":\"{}\",\"metadata\":{},\"method\":\"Index\",\"port\":9000,\"service\":\"grpcbin.GRPCBin\"},\"retry\":{\"count\":0,\"interval\":300},\"subtype\":\"grpc\"}]},\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_test_multi_step_payload.json\",\"name\":\"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1733743090\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1733743090\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":1000},\"tick_every\":60},\"subtype\":\"multi\",\"tags\":[\"testing:api\"],\"type\":\"api\"}"
35+
"text": "{\"config\":{\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"steps\":[{\"allowFailure\":true,\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"exitIfSucceed\":true,\"extractedValues\":[{\"field\":\"server\",\"name\":\"EXTRACTED_VALUE\",\"parser\":{\"type\":\"raw\"},\"secure\":true,\"type\":\"http_header\"}],\"extractedValuesFromScript\":\"dd.variable.set('STATUS_CODE', dd.response.statusCode);\",\"isCritical\":true,\"name\":\"request is sent\",\"request\":{\"httpVersion\":\"http2\",\"method\":\"GET\",\"timeout\":10,\"url\":\"https://datadoghq.com\"},\"retry\":{\"count\":5,\"interval\":1000},\"subtype\":\"http\"},{\"name\":\"Wait\",\"subtype\":\"wait\",\"value\":1},{\"allowFailure\":false,\"assertions\":[{\"operator\":\"lessThan\",\"target\":1000,\"type\":\"responseTime\"}],\"extractedValues\":[],\"isCritical\":true,\"name\":\"GRPC CALL\",\"request\":{\"callType\":\"unary\",\"compressedJsonDescriptor\":\"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==\",\"host\":\"grpcbin.test.k6.io\",\"message\":\"{}\",\"metadata\":{},\"method\":\"Index\",\"port\":9000,\"service\":\"grpcbin.GRPCBin\"},\"retry\":{\"count\":0,\"interval\":300},\"subtype\":\"grpc\"}]},\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_test_multi_step_payload.json\",\"name\":\"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1740501272\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1740501272\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":1000},\"tick_every\":60},\"subtype\":\"multi\",\"tags\":[\"testing:api\"],\"type\":\"api\"}"
3636
},
3737
"queryString": [],
3838
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/api"
3939
},
4040
"response": {
41-
"bodySize": 2737,
41+
"bodySize": 2917,
4242
"content": {
4343
"mimeType": "application/json",
44-
"size": 2737,
45-
"text": "{\"public_id\":\"bt4-37i-f6g\",\"name\":\"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1733743090\",\"status\":\"live\",\"type\":\"api\",\"subtype\":\"multi\",\"tags\":[\"testing:api\"],\"created_at\":\"2024-12-09T11:18:10.752463+00:00\",\"modified_at\":\"2024-12-09T11:18:10.752463+00:00\",\"config\":{\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"steps\":[{\"allowFailure\":true,\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"exitIfSucceed\":true,\"extractedValues\":[{\"field\":\"server\",\"name\":\"EXTRACTED_VALUE\",\"parser\":{\"type\":\"raw\"},\"secure\":true,\"type\":\"http_header\"}],\"isCritical\":true,\"name\":\"request is sent\",\"request\":{\"httpVersion\":\"http2\",\"method\":\"GET\",\"timeout\":10,\"url\":\"https://datadoghq.com\"},\"retry\":{\"count\":5,\"interval\":1000},\"subtype\":\"http\",\"id\":\"95e-ghs-fm7\"},{\"name\":\"Wait\",\"subtype\":\"wait\",\"value\":1,\"id\":\"mq5-qta-v4b\"},{\"allowFailure\":false,\"assertions\":[{\"operator\":\"lessThan\",\"target\":1000,\"type\":\"responseTime\"}],\"extractedValues\":[],\"isCritical\":true,\"name\":\"GRPC CALL\",\"request\":{\"callType\":\"unary\",\"compressedJsonDescriptor\":\"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==\",\"host\":\"grpcbin.test.k6.io\",\"message\":\"{}\",\"metadata\":{},\"method\":\"Index\",\"port\":9000,\"service\":\"grpcbin.GRPCBin\"},\"retry\":{\"count\":0,\"interval\":300},\"subtype\":\"grpc\",\"id\":\"ccj-2jk-5ew\"}]},\"message\":\"BDD test payload: synthetics_api_test_multi_step_payload.json\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1733743090\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":1000},\"tick_every\":60},\"locations\":[\"aws:us-east-2\"],\"created_by\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"},\"deleted_at\":null,\"monitor_id\":159881044,\"org_id\":321813,\"modified_by\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\"}}"
44+
"size": 2917,
45+
"text": "{\"public_id\":\"xbn-4ef-iaf\",\"name\":\"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1740501272\",\"status\":\"live\",\"type\":\"api\",\"subtype\":\"multi\",\"tags\":[\"testing:api\"],\"created_at\":\"2025-02-25T16:34:33.210809+00:00\",\"modified_at\":\"2025-02-25T16:34:33.210809+00:00\",\"config\":{\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"steps\":[{\"allowFailure\":true,\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"exitIfSucceed\":true,\"extractedValues\":[{\"field\":\"server\",\"name\":\"EXTRACTED_VALUE\",\"parser\":{\"type\":\"raw\"},\"secure\":true,\"type\":\"http_header\"}],\"extractedValuesFromScript\":\"dd.variable.set('STATUS_CODE', dd.response.statusCode);\",\"isCritical\":true,\"name\":\"request is sent\",\"request\":{\"httpVersion\":\"http2\",\"method\":\"GET\",\"timeout\":10,\"url\":\"https://datadoghq.com\"},\"retry\":{\"count\":5,\"interval\":1000},\"subtype\":\"http\",\"id\":\"4z3-ufk-5rx\"},{\"name\":\"Wait\",\"subtype\":\"wait\",\"value\":1,\"id\":\"dyn-2dd-g5j\"},{\"allowFailure\":false,\"assertions\":[{\"operator\":\"lessThan\",\"target\":1000,\"type\":\"responseTime\"}],\"extractedValues\":[],\"isCritical\":true,\"name\":\"GRPC CALL\",\"request\":{\"callType\":\"unary\",\"compressedJsonDescriptor\":\"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==\",\"host\":\"grpcbin.test.k6.io\",\"message\":\"{}\",\"metadata\":{},\"method\":\"Index\",\"port\":9000,\"service\":\"grpcbin.GRPCBin\"},\"retry\":{\"count\":0,\"interval\":300},\"subtype\":\"grpc\",\"id\":\"msb-wjm-zt6\"}]},\"message\":\"BDD test payload: synthetics_api_test_multi_step_payload.json\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1740501272\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":1000},\"tick_every\":60},\"locations\":[\"aws:us-east-2\"],\"created_by\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\"},\"deleted_at\":null,\"monitor_id\":165393063,\"org_id\":321813,\"modified_by\":{\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"email\":\"team-intg-tools-libs-spam@datadoghq.com\"}}"
4646
},
4747
"cookies": [],
4848
"headers": [
@@ -57,11 +57,11 @@
5757
"status": 200,
5858
"statusText": "OK"
5959
},
60-
"startedDateTime": "2024-12-09T11:18:10.118Z",
61-
"time": 788
60+
"startedDateTime": "2025-02-25T16:34:32.561Z",
61+
"time": 832
6262
},
6363
{
64-
"_id": "9eca6e5072f04e1850216b2142d1412b",
64+
"_id": "b33b3d0429e284eab315e19b606b0162",
6565
"_order": 0,
6666
"cache": {},
6767
"request": {
@@ -85,7 +85,7 @@
8585
"postData": {
8686
"mimeType": "application/json",
8787
"params": [],
88-
"text": "{\"public_ids\":[\"bt4-37i-f6g\"]}"
88+
"text": "{\"public_ids\":[\"xbn-4ef-iaf\"]}"
8989
},
9090
"queryString": [],
9191
"url": "https://api.datadoghq.com/api/v1/synthetics/tests/delete"
@@ -95,7 +95,7 @@
9595
"content": {
9696
"mimeType": "application/json",
9797
"size": 96,
98-
"text": "{\"deleted_tests\":[{\"public_id\":\"bt4-37i-f6g\",\"deleted_at\":\"2024-12-09T11:18:11.699226+00:00\"}]}\n"
98+
"text": "{\"deleted_tests\":[{\"public_id\":\"xbn-4ef-iaf\",\"deleted_at\":\"2025-02-25T16:34:34.204246+00:00\"}]}\n"
9999
},
100100
"cookies": [],
101101
"headers": [
@@ -110,8 +110,8 @@
110110
"status": 200,
111111
"statusText": "OK"
112112
},
113-
"startedDateTime": "2024-12-09T11:18:10.916Z",
114-
"time": 977
113+
"startedDateTime": "2025-02-25T16:34:33.402Z",
114+
"time": 1052
115115
}
116116
],
117117
"pages": [],

Diff for: examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.ts

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const params: v1.SyntheticsApiCreateSyntheticsAPITestRequest = {
5353
interval: 1000,
5454
},
5555
subtype: "http",
56+
extractedValuesFromScript:
57+
"dd.variable.set('STATUS_CODE', dd.response.statusCode);",
5658
},
5759
{
5860
name: "Wait",

0 commit comments

Comments
 (0)