Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Synthetics] Add isCritical to browser test steps #1327

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-02-11 15:01:43.065174",
"spec_repo_commit": "0aeef32"
"regenerated": "2022-02-11 17:09:50.628260",
"spec_repo_commit": "f8964dd"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-02-11 15:01:43.077011",
"spec_repo_commit": "0aeef32"
"regenerated": "2022-02-11 17:09:50.640365",
"spec_repo_commit": "f8964dd"
}
}
}
4 changes: 4 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11527,6 +11527,10 @@ components:
allowFailure:
description: A boolean set to allow this step to fail.
type: boolean
isCritical:
description: A boolean to use in addition to `allowFailure` to determine
if the test should be marked as failed when the step fails.
type: boolean
name:
description: The name of the step.
type: string
Expand Down
40 changes: 33 additions & 7 deletions api/v1/datadog/docs/SyntheticsStep.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

## Properties

| Name | Type | Description | Notes |
| ---------------- | ---------------------------------------------------------- | ----------------------------------------- | ---------- |
| **AllowFailure** | Pointer to **bool** | A boolean set to allow this step to fail. | [optional] |
| **Name** | Pointer to **string** | The name of the step. | [optional] |
| **Params** | Pointer to **interface{}** | The parameters of the step. | [optional] |
| **Timeout** | Pointer to **int64** | The time before declaring a step failed. | [optional] |
| **Type** | Pointer to [**SyntheticsStepType**](SyntheticsStepType.md) | | [optional] |
| Name | Type | Description | Notes |
| ---------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| **AllowFailure** | Pointer to **bool** | A boolean set to allow this step to fail. | [optional] |
| **IsCritical** | Pointer to **bool** | A boolean to use in addition to `allowFailure` to determine if the test should be marked as failed when the step fails. | [optional] |
| **Name** | Pointer to **string** | The name of the step. | [optional] |
| **Params** | Pointer to **interface{}** | The parameters of the step. | [optional] |
| **Timeout** | Pointer to **int64** | The time before declaring a step failed. | [optional] |
| **Type** | Pointer to [**SyntheticsStepType**](SyntheticsStepType.md) | | [optional] |

## Methods

Expand Down Expand Up @@ -54,6 +55,31 @@ SetAllowFailure sets AllowFailure field to given value.

HasAllowFailure returns a boolean if a field has been set.

### GetIsCritical

`func (o *SyntheticsStep) GetIsCritical() bool`

GetIsCritical returns the IsCritical field if non-nil, zero value otherwise.

### GetIsCriticalOk

`func (o *SyntheticsStep) GetIsCriticalOk() (*bool, bool)`

GetIsCriticalOk returns a tuple with the IsCritical field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetIsCritical

`func (o *SyntheticsStep) SetIsCritical(v bool)`

SetIsCritical sets IsCritical field to given value.

### HasIsCritical

`func (o *SyntheticsStep) HasIsCritical() bool`

HasIsCritical returns a boolean if a field has been set.

### GetName

`func (o *SyntheticsStep) GetName() string`
Expand Down
39 changes: 39 additions & 0 deletions api/v1/datadog/model_synthetics_step.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions examples/v1/synthetics/CreateSyntheticsBrowserTest.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ func main() {
"testing:browser",
},
Type: datadog.SYNTHETICSBROWSERTESTTYPE_BROWSER,
Steps: &[]datadog.SyntheticsStep{
{
AllowFailure: datadog.PtrBool(false),
IsCritical: datadog.PtrBool(true),
Name: datadog.PtrString("Refresh page"),
Params: new(interface{}),
Type: datadog.SYNTHETICSSTEPTYPE_REFRESH.Ptr(),
},
},
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-01-06T00:51:13.534Z
2022-02-10T12:24:10.485Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: |
{"config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test"},"locations":["aws:us-east-2"],"message":"Test message","name":"Test-Create_a_browser_test_returns_OK_Returns_the_created_test_details_response-1641430273","options":{"accept_self_signed":false,"allow_insecure":true,"device_ids":["tablet"],"disableCors":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":3,"interval":10},"tick_every":300},"tags":["testing:browser"],"type":"browser"}
{"config":{"assertions":[],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"method":"GET","url":"https://datadoghq.com"},"setCookie":"name:test"},"locations":["aws:us-east-2"],"message":"Test message","name":"Test-Create_a_browser_test_returns_OK_Returns_the_created_test_details_response-1644495850","options":{"accept_self_signed":false,"allow_insecure":true,"device_ids":["tablet"],"disableCors":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"noScreenshot":true,"retry":{"count":3,"interval":10},"tick_every":300},"steps":[{"allowFailure":false,"isCritical":true,"name":"Refresh page","params":{},"type":"refresh"}],"tags":["testing:browser"],"type":"browser"}
form: {}
headers:
Accept:
Expand All @@ -11,8 +11,9 @@ interactions:
method: POST
url: https://api.datadoghq.com/api/v1/synthetics/tests/browser
response:
body: '{"status":"paused","public_id":"db9-2t7-rc6","tags":["testing:browser"],"org_id":321813,"locations":["aws:us-east-2"],"message":"Test
message","deleted_at":null,"name":"Test-Create_a_browser_test_returns_OK_Returns_the_created_test_details_response-1641430273","monitor_id":59800820,"type":"browser","created_at":"2022-01-06T00:51:13.906186+00:00","modified_at":"2022-01-06T00:51:13.906186+00:00","config":{"setCookie":"name:test","request":{"url":"https://datadoghq.com","method":"GET"},"assertions":[],"configVariables":[{"pattern":"content-type","type":"text","example":"content-type","name":"PROPERTY"}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":1,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"noScreenshot":true,"disableCors":true,"device_ids":["tablet"],"tick_every":300}}'
body: '{"status":"paused","public_id":"rsw-sd4-iu5","tags":["testing:browser"],"org_id":321813,"locations":["aws:us-east-2"],"message":"Test
message","deleted_at":null,"name":"Test-Create_a_browser_test_returns_OK_Returns_the_created_test_details_response-1644495850","monitor_id":63812386,"type":"browser","created_at":"2022-02-10T12:24:11.196393+00:00","modified_at":"2022-02-10T12:24:11.196393+00:00","steps":[{"name":"Refresh
page","allowFailure":false,"params":{},"isCritical":true,"type":"refresh"}],"config":{"setCookie":"name:test","request":{"url":"https://datadoghq.com","method":"GET"},"assertions":[],"configVariables":[{"pattern":"content-type","type":"text","example":"content-type","name":"PROPERTY"}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":1,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"noScreenshot":true,"disableCors":true,"device_ids":["tablet"],"tick_every":300}}'
code: 200
duration: ''
headers:
Expand All @@ -21,7 +22,7 @@ interactions:
status: 200 OK
- request:
body: |
{"public_ids":["db9-2t7-rc6"]}
{"public_ids":["rsw-sd4-iu5"]}
form: {}
headers:
Accept:
Expand All @@ -31,7 +32,7 @@ interactions:
method: POST
url: https://api.datadoghq.com/api/v1/synthetics/tests/delete
response:
body: '{"deleted_tests":[{"deleted_at":"2022-01-06T00:51:14.154081+00:00","public_id":"db9-2t7-rc6"}]}'
body: '{"deleted_tests":[{"deleted_at":"2022-02-10T12:24:11.753160+00:00","public_id":"rsw-sd4-iu5"}]}'
code: 200
duration: ''
headers:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-01-11T18:26:30.141Z
2022-02-10T12:24:11.728Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: |
{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapitestreturnsokreturnsthecreatedtestdetailsresponse1641925590"},"method":"GET","proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_test_payload.json","name":"Test-Create_an_API_test_returns_OK_Returns_the_created_test_details_response-1641925590","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_returns_OK_Returns_the_created_test_details_response-1641925590","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}
{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"certificate":{"cert":{"content":"cert-content","filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"content":"key-content","filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"headers":{"unique":"testcreateanapitestreturnsokreturnsthecreatedtestdetailsresponse1644495851"},"method":"GET","proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_test_payload.json","name":"Test-Create_an_API_test_returns_OK_Returns_the_created_test_details_response-1644495851","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_returns_OK_Returns_the_created_test_details_response-1644495851","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}
form: {}
headers:
Accept:
Expand All @@ -11,9 +11,9 @@ interactions:
method: POST
url: https://api.datadoghq.com/api/v1/synthetics/tests/api
response:
body: '{"status":"live","public_id":"gbf-27x-fyf","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD
test payload: synthetics_api_test_payload.json","deleted_at":null,"name":"Test-Create_an_API_test_returns_OK_Returns_the_created_test_details_response-1641925590","monitor_id":60619278,"type":"api","created_at":"2022-01-11T18:26:30.681233+00:00","modified_at":"2022-01-11T18:26:30.681233+00:00","subtype":"http","config":{"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"url":"https://datadoghq.com","headers":{"unique":"testcreateanapitestreturnsokreturnsthecreatedtestdetailsresponse1641925590"},"proxy":{"url":"https://datadoghq.com","headers":{}},"timeout":10,"method":"GET"},"assertions":[{"operator":"is","property":"{{
PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"configVariables":[{"pattern":"content-type","type":"text","example":"content-type","name":"PROPERTY"}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":1,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"monitor_priority":5,"monitor_name":"Test-Create_an_API_test_returns_OK_Returns_the_created_test_details_response-1641925590","tick_every":60}}'
body: '{"status":"live","public_id":"x87-4ez-4xz","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"BDD
test payload: synthetics_api_test_payload.json","deleted_at":null,"name":"Test-Create_an_API_test_returns_OK_Returns_the_created_test_details_response-1644495851","monitor_id":63812387,"type":"api","created_at":"2022-02-10T12:24:12.489088+00:00","modified_at":"2022-02-10T12:24:12.489088+00:00","subtype":"http","config":{"request":{"certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"url":"https://datadoghq.com","headers":{"unique":"testcreateanapitestreturnsokreturnsthecreatedtestdetailsresponse1644495851"},"proxy":{"url":"https://datadoghq.com","headers":{}},"timeout":10,"method":"GET"},"assertions":[{"operator":"is","property":"{{
PROPERTY }}","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}],"configVariables":[{"pattern":"content-type","type":"text","example":"content-type","name":"PROPERTY"}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":1,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"monitor_priority":5,"monitor_name":"Test-Create_an_API_test_returns_OK_Returns_the_created_test_details_response-1644495851","tick_every":60}}'
code: 200
duration: ''
headers:
Expand All @@ -22,7 +22,7 @@ interactions:
status: 200 OK
- request:
body: |
{"public_ids":["gbf-27x-fyf"]}
{"public_ids":["x87-4ez-4xz"]}
form: {}
headers:
Accept:
Expand All @@ -32,7 +32,7 @@ interactions:
method: POST
url: https://api.datadoghq.com/api/v1/synthetics/tests/delete
response:
body: '{"deleted_tests":[{"deleted_at":"2022-01-11T18:26:32.034575+00:00","public_id":"gbf-27x-fyf"}]}'
body: '{"deleted_tests":[{"deleted_at":"2022-02-10T12:24:13.010432+00:00","public_id":"x87-4ez-4xz"}]}'
code: 200
duration: ''
headers:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-01-06T00:51:15.154Z
2022-02-10T12:24:13.013Z
Loading