Skip to content

Commit f0112fa

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add exitIfSucceed to multistep API tests (#2307)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 5332aa3 commit f0112fa

File tree

57 files changed

+223
-207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+223
-207
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
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": "2024-12-05 20:22:41.090262",
8-
"spec_repo_commit": "970515f9"
7+
"regenerated": "2024-12-09 11:21:40.525950",
8+
"spec_repo_commit": "21da0df3"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-12-05 20:22:41.108521",
13-
"spec_repo_commit": "970515f9"
12+
"regenerated": "2024-12-09 11:21:40.543995",
13+
"spec_repo_commit": "21da0df3"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13741,6 +13741,9 @@ components:
1374113741
items:
1374213742
$ref: '#/components/schemas/SyntheticsAssertion'
1374313743
type: array
13744+
exitIfSucceed:
13745+
description: Determines whether or not to exit the test if the step succeeds.
13746+
type: boolean
1374413747
extractedValues:
1374513748
description: Array of values to parse and save as variables from the response.
1374613749
items:

examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
target=200,
5151
),
5252
],
53+
exit_if_succeed=True,
5354
extracted_values=[
5455
SyntheticsParsingOptions(
5556
field="server",

examples/v1/synthetics/CreateSyntheticsBrowserTest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@
7575
steps=[
7676
SyntheticsStep(
7777
allow_failure=False,
78+
always_execute=True,
79+
exit_if_succeed=True,
7880
is_critical=True,
7981
name="Refresh page",
8082
params=dict(),

src/datadog_api_client/v1/model/synthetics_api_step.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def __init__(self, **kwargs):
2121
:param assertions: Array of assertions used for the test.
2222
:type assertions: [SyntheticsAssertion]
2323
24+
:param exit_if_succeed: Determines whether or not to exit the test if the step succeeds.
25+
:type exit_if_succeed: bool, optional
26+
2427
:param extracted_values: Array of values to parse and save as variables from the response.
2528
:type extracted_values: [SyntheticsParsingOptions], optional
2629

src/datadog_api_client/v1/model/synthetics_api_test_step.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def openapi_types(_):
3232
return {
3333
"allow_failure": (bool,),
3434
"assertions": ([SyntheticsAssertion],),
35+
"exit_if_succeed": (bool,),
3536
"extracted_values": ([SyntheticsParsingOptions],),
3637
"is_critical": (bool,),
3738
"name": (str,),
@@ -43,6 +44,7 @@ def openapi_types(_):
4344
attribute_map = {
4445
"allow_failure": "allowFailure",
4546
"assertions": "assertions",
47+
"exit_if_succeed": "exitIfSucceed",
4648
"extracted_values": "extractedValues",
4749
"is_critical": "isCritical",
4850
"name": "name",
@@ -57,6 +59,7 @@ def __init__(
5759
request: SyntheticsTestRequest,
5860
subtype: SyntheticsAPITestStepSubtype,
5961
allow_failure: Union[bool, UnsetType] = unset,
62+
exit_if_succeed: Union[bool, UnsetType] = unset,
6063
extracted_values: Union[List[SyntheticsParsingOptions], UnsetType] = unset,
6164
is_critical: Union[bool, UnsetType] = unset,
6265
retry: Union[SyntheticsTestOptionsRetry, UnsetType] = unset,
@@ -71,6 +74,9 @@ def __init__(
7174
:param assertions: Array of assertions used for the test.
7275
:type assertions: [SyntheticsAssertion]
7376
77+
:param exit_if_succeed: Determines whether or not to exit the test if the step succeeds.
78+
:type exit_if_succeed: bool, optional
79+
7480
:param extracted_values: Array of values to parse and save as variables from the response.
7581
:type extracted_values: [SyntheticsParsingOptions], optional
7682
@@ -92,6 +98,8 @@ def __init__(
9298
"""
9399
if allow_failure is not unset:
94100
kwargs["allow_failure"] = allow_failure
101+
if exit_if_succeed is not unset:
102+
kwargs["exit_if_succeed"] = exit_if_succeed
95103
if extracted_values is not unset:
96104
kwargs["extracted_values"] = extracted_values
97105
if is_critical is not unset:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-01-26T10:20:21.858Z
1+
2024-12-09T11:17:43.729Z

tests/v1/cassettes/test_scenarios/test_create_a_browser_test_returns_ok_returns_saved_rumsettings_response.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: '{"config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificateDomains":["https://datadoghq.com"],"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test"},"locations":["aws:us-east-2"],"message":"Test
4-
message","name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1706264421","options":{"accept_self_signed":false,"allow_insecure":true,"ci":{"executionRule":"skipped"},"device_ids":["tablet"],"disableCors":true,"disableCsp":true,"follow_redirects":true,"ignoreServerCertificateError":true,"initialNavigationTimeout":200,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"rumSettings":{"applicationId":"mockApplicationId","clientTokenId":12345,"isEnabled":true},"tick_every":300},"steps":[{"allowFailure":false,"isCritical":true,"name":"Refresh
4+
message","name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1733743063","options":{"accept_self_signed":false,"allow_insecure":true,"ci":{"executionRule":"skipped"},"device_ids":["tablet"],"disableCors":true,"disableCsp":true,"follow_redirects":true,"ignoreServerCertificateError":true,"initialNavigationTimeout":200,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"rumSettings":{"applicationId":"mockApplicationId","clientTokenId":12345,"isEnabled":true},"tick_every":300},"steps":[{"allowFailure":false,"isCritical":true,"name":"Refresh
55
page","params":{},"type":"refresh"}],"tags":["testing:browser"],"type":"browser"}'
66
headers:
77
accept:
@@ -12,17 +12,17 @@ interactions:
1212
uri: https://api.datadoghq.com/api/v1/synthetics/tests/browser
1313
response:
1414
body:
15-
string: '{"public_id":"y2r-gnr-i3n","name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1706264421","status":"paused","type":"browser","tags":["testing:browser"],"created_at":"2024-01-26T10:20:22.506547+00:00","modified_at":"2024-01-26T10:20:22.506547+00:00","config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificateDomains":["https://datadoghq.com"],"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test"},"message":"Test
16-
message","options":{"accept_self_signed":false,"allow_insecure":true,"ci":{"executionRule":"skipped"},"device_ids":["tablet"],"disableCors":true,"disableCsp":true,"follow_redirects":true,"ignoreServerCertificateError":true,"initialNavigationTimeout":200,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"rumSettings":{"applicationId":"mockApplicationId","clientTokenId":12345,"isEnabled":true},"tick_every":300},"locations":["aws:us-east-2"],"created_by":{"name":"Frog","handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":138446062,"org_id":569509,"modified_by":{"name":"Frog","handle":"[email protected]","email":"[email protected]"},"steps":[{"name":"Refresh
17-
page","params":{},"type":"refresh","allowFailure":false,"isCritical":true}],"stepCount":{"assertions":0,"subtests":0,"total":1}}'
15+
string: '{"public_id":"jj5-nke-dq2","name":"Test-Create_a_browser_test_returns_OK_Returns_saved_rumSettings_response-1733743063","status":"paused","type":"browser","tags":["testing:browser"],"created_at":"2024-12-09T11:17:44.348239+00:00","modified_at":"2024-12-09T11:17:44.348239+00:00","config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificateDomains":["https://datadoghq.com"],"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test"},"message":"Test
16+
message","options":{"accept_self_signed":false,"allow_insecure":true,"ci":{"executionRule":"skipped"},"device_ids":["tablet"],"disableCors":true,"disableCsp":true,"follow_redirects":true,"ignoreServerCertificateError":true,"initialNavigationTimeout":200,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"rumSettings":{"applicationId":"mockApplicationId","clientTokenId":12345,"isEnabled":true},"tick_every":300},"locations":["aws:us-east-2"],"created_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":159881000,"org_id":321813,"modified_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"steps":[{"name":"Refresh
17+
page","params":{},"type":"refresh","public_id":"yb6-rim-kwp","allowFailure":false,"isCritical":true}],"stepCount":{"assertions":0,"subtests":0,"total":1}}'
1818
headers:
1919
content-type:
2020
- application/json
2121
status:
2222
code: 200
2323
message: OK
2424
- request:
25-
body: '{"public_ids":["y2r-gnr-i3n"]}'
25+
body: '{"public_ids":["jj5-nke-dq2"]}'
2626
headers:
2727
accept:
2828
- application/json
@@ -32,7 +32,7 @@ interactions:
3232
uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete
3333
response:
3434
body:
35-
string: '{"deleted_tests":[{"public_id":"y2r-gnr-i3n","deleted_at":"2024-01-26T10:20:23.057714+00:00"}]}
35+
string: '{"deleted_tests":[{"public_id":"jj5-nke-dq2","deleted_at":"2024-12-09T11:17:45.340410+00:00"}]}
3636
3737
'
3838
headers:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024-07-10T11:52:27.901Z
1+
2024-12-09T11:17:45.545Z

tests/v1/cassettes/test_scenarios/test_create_a_browser_test_returns_ok_returns_the_created_test_details_response.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
33
body: '{"config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","secure":true,"type":"text"}],"request":{"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test","variables":[{"example":"secret","name":"TEST_VARIABLE","pattern":"secret","secure":true,"type":"text"}]},"locations":["aws:us-east-2"],"message":"Test
4-
message","name":"Test-Create_a_browser_test_returns_OK_Returns_the_created_test_details_response-1720612347","options":{"accept_self_signed":false,"allow_insecure":true,"device_ids":["chrome.laptop_large"],"disableCors":true,"enableProfiling":true,"enableSecurityTesting":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"tick_every":300},"steps":[{"allowFailure":false,"isCritical":true,"name":"Refresh
4+
message","name":"Test-Create_a_browser_test_returns_OK_Returns_the_created_test_details_response-1733743065","options":{"accept_self_signed":false,"allow_insecure":true,"device_ids":["chrome.laptop_large"],"disableCors":true,"enableProfiling":true,"enableSecurityTesting":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"tick_every":300},"steps":[{"allowFailure":false,"alwaysExecute":true,"exitIfSucceed":true,"isCritical":true,"name":"Refresh
55
page","params":{},"type":"refresh"}],"tags":["testing:browser"],"type":"browser"}'
66
headers:
77
accept:
@@ -12,17 +12,17 @@ interactions:
1212
uri: https://api.datadoghq.com/api/v1/synthetics/tests/browser
1313
response:
1414
body:
15-
string: '{"public_id":"j34-jum-nef","name":"Test-Create_a_browser_test_returns_OK_Returns_the_created_test_details_response-1720612347","status":"paused","type":"browser","tags":["testing:browser"],"created_at":"2024-07-10T11:52:28.494877+00:00","modified_at":"2024-07-10T11:52:28.494877+00:00","config":{"assertions":[],"configVariables":[{"name":"PROPERTY","secure":true,"type":"text"}],"request":{"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test","variables":[{"name":"TEST_VARIABLE","secure":true,"type":"text"}]},"message":"Test
16-
message","options":{"accept_self_signed":false,"allow_insecure":true,"device_ids":["chrome.laptop_large"],"disableCors":true,"enableProfiling":true,"enableSecurityTesting":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"tick_every":300},"locations":["aws:us-east-2"],"created_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":148931232,"org_id":321813,"modified_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"steps":[{"name":"Refresh
17-
page","params":{},"type":"refresh","allowFailure":false,"isCritical":true}],"stepCount":{"assertions":0,"subtests":0,"total":1}}'
15+
string: '{"public_id":"y49-diz-cwy","name":"Test-Create_a_browser_test_returns_OK_Returns_the_created_test_details_response-1733743065","status":"paused","type":"browser","tags":["testing:browser"],"created_at":"2024-12-09T11:17:46.150300+00:00","modified_at":"2024-12-09T11:17:46.150300+00:00","config":{"assertions":[],"configVariables":[{"name":"PROPERTY","secure":true,"type":"text"}],"request":{"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test","variables":[{"name":"TEST_VARIABLE","secure":true,"type":"text"}]},"message":"Test
16+
message","options":{"accept_self_signed":false,"allow_insecure":true,"device_ids":["chrome.laptop_large"],"disableCors":true,"enableProfiling":true,"enableSecurityTesting":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":2,"interval":10},"tick_every":300},"locations":["aws:us-east-2"],"created_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":159881002,"org_id":321813,"modified_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"steps":[{"name":"Refresh
17+
page","params":{},"type":"refresh","public_id":"uyu-hni-jav","allowFailure":false,"isCritical":true,"exitIfSucceed":true,"alwaysExecute":true}],"stepCount":{"assertions":0,"subtests":0,"total":1}}'
1818
headers:
1919
content-type:
2020
- application/json
2121
status:
2222
code: 200
2323
message: OK
2424
- request:
25-
body: '{"public_ids":["j34-jum-nef"]}'
25+
body: '{"public_ids":["y49-diz-cwy"]}'
2626
headers:
2727
accept:
2828
- application/json
@@ -32,7 +32,7 @@ interactions:
3232
uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete
3333
response:
3434
body:
35-
string: '{"deleted_tests":[{"public_id":"j34-jum-nef","deleted_at":"2024-07-10T11:52:30.153321+00:00"}]}
35+
string: '{"deleted_tests":[{"public_id":"y49-diz-cwy","deleted_at":"2024-12-09T11:17:47.130391+00:00"}]}
3636
3737
'
3838
headers:

0 commit comments

Comments
 (0)