Skip to content

Add originalFileName field to the SyntheticsTestRequestBodyFile definition #1988

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

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.6",
"regenerated": "2024-06-03 16:54:47.128661",
"spec_repo_commit": "df6778e5"
"regenerated": "2024-06-04 15:12:27.144633",
"spec_repo_commit": "60183db6"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-06-03 16:54:47.145931",
"spec_repo_commit": "df6778e5"
"regenerated": "2024-06-04 15:12:27.161123",
"spec_repo_commit": "60183db6"
}
}
}
4 changes: 4 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16075,6 +16075,10 @@ components:
description: Name of the file.
maxLength: 1500
type: string
originalFileName:
description: Original name of the file.
maxLength: 1500
type: string
size:
description: Size of the file.
format: int64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
files=[
SyntheticsTestRequestBodyFile(
name="file name",
original_file_name="image.png",
content="file content",
type="file type",
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class SyntheticsTestRequestBodyFile(ModelNormal):
"name": {
"max_length": 1500,
},
"original_file_name": {
"max_length": 1500,
},
"size": {
"inclusive_maximum": 3145728,
"inclusive_minimum": 1,
Expand All @@ -36,6 +39,7 @@ def openapi_types(_):
"bucket_key": (str,),
"content": (str,),
"name": (str,),
"original_file_name": (str,),
"size": (int,),
"type": (str,),
}
Expand All @@ -44,6 +48,7 @@ def openapi_types(_):
"bucket_key": "bucketKey",
"content": "content",
"name": "name",
"original_file_name": "originalFileName",
"size": "size",
"type": "type",
}
Expand All @@ -53,6 +58,7 @@ def __init__(
bucket_key: Union[str, UnsetType] = unset,
content: Union[str, UnsetType] = unset,
name: Union[str, UnsetType] = unset,
original_file_name: Union[str, UnsetType] = unset,
size: Union[int, UnsetType] = unset,
type: Union[str, UnsetType] = unset,
**kwargs,
Expand All @@ -69,6 +75,9 @@ def __init__(
:param name: Name of the file.
:type name: str, optional

:param original_file_name: Original name of the file.
:type original_file_name: str, optional

:param size: Size of the file.
:type size: int, optional

Expand All @@ -81,6 +90,8 @@ def __init__(
kwargs["content"] = content
if name is not unset:
kwargs["name"] = name
if original_file_name is not unset:
kwargs["original_file_name"] = original_file_name
if size is not unset:
kwargs["size"] = size
if type is not unset:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-04-02T15:35:39.188Z
2024-05-30T13:32:57.127Z
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
interactions:
- request:
body: '{"config":{"assertions":[{"operator":"is","property":"{{ PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"bodyType":"application/octet-stream","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"}},"files":[{"content":"file
content","name":"file name","type":"file type"}],"headers":{"unique":"testcreateanapitestwithafilepayloadreturnsokreturnsthecreatedtestdetailsresponse1712072139"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD
test payload: synthetics_api_http_test_payload.json","name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1712072139","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1712072139","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}'
content","name":"file name","originalFileName":"image.png","type":"file type"}],"headers":{"unique":"testcreateanapitestwithafilepayloadreturnsokreturnsthecreatedtestdetailsresponse1717075977"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"BDD
test payload: synthetics_api_http_test_payload.json","name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1717075977","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1717075977","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"}'
headers:
accept:
- application/json
Expand All @@ -12,18 +12,18 @@ interactions:
uri: https://api.datadoghq.com/api/v1/synthetics/tests/api
response:
body:
string: '{"public_id":"sxp-kz5-mk7","name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1712072139","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-04-02T15:35:40.509801+00:00","modified_at":"2024-04-02T15:35:40.509801+00:00","config":{"assertions":[{"operator":"is","property":"{{
string: '{"public_id":"59e-ema-ct7","name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1717075977","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-05-30T13:32:58.047080+00:00","modified_at":"2024-05-30T13:32:58.047080+00:00","config":{"assertions":[{"operator":"is","property":"{{
PROPERTY }}","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"timingsScope":"withoutDNS","type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"},{"operator":"validatesXPath","target":{"operator":"contains","targetValue":"0","xPath":"target-xpath"},"type":"body"}],"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"request":{"basicAuth":{"accessTokenUrl":"https://datadog-token.com","audience":"audience","clientId":"client-id","clientSecret":"client-secret","resource":"resource","scope":"yoyo","tokenApiAuthentication":"header","type":"oauth-client"},"bodyType":"application/octet-stream","certificate":{"cert":{"filename":"cert-filename","updatedAt":"2020-10-16T09:23:24.857Z"},"key":{"filename":"key-filename","updatedAt":"2020-10-16T09:23:24.857Z"}},"files":[{"name":"file
name","type":"file type","bucketKey":"api-upload-file/sxp-kz5-mk7/2024-04-02T15:35:40.363501_da19b48f-1756-453d-a03d-90526e629d7e.json"}],"headers":{"unique":"testcreateanapitestwithafilepayloadreturnsokreturnsthecreatedtestdetailsresponse1712072139"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"message":"BDD
test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1712072139","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":142439982,"org_id":321813,"modified_by":{"name":null,"handle":"[email protected]","email":"[email protected]"}}'
name","originalFileName":"image.png","type":"file type","bucketKey":"api-upload-file/59e-ema-ct7/2024-05-30T13:32:57.804785_39e7dc32-8533-4979-b741-f10052a5e300.json"}],"headers":{"unique":"testcreateanapitestwithafilepayloadreturnsokreturnsthecreatedtestdetailsresponse1717075977"},"method":"GET","persistCookies":true,"proxy":{"headers":{},"url":"https://datadoghq.com"},"timeout":10,"url":"https://datadoghq.com"}},"message":"BDD
test payload: synthetics_api_http_test_payload.json","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"httpVersion":"http2","min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_an_API_test_with_a_file_payload_returns_OK_Returns_the_created_test_details_response-1717075977","monitor_priority":5,"retry":{"count":3,"interval":10},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"http","created_by":{"name":null,"handle":"[email protected]","email":"[email protected]"},"deleted_at":null,"monitor_id":145992674,"org_id":321813,"modified_by":{"name":null,"handle":"[email protected]","email":"[email protected]"}}'
headers:
content-type:
- application/json
status:
code: 200
message: OK
- request:
body: '{"public_ids":["sxp-kz5-mk7"]}'
body: '{"public_ids":["59e-ema-ct7"]}'
headers:
accept:
- application/json
Expand All @@ -33,7 +33,7 @@ interactions:
uri: https://api.datadoghq.com/api/v1/synthetics/tests/delete
response:
body:
string: '{"deleted_tests":[{"public_id":"sxp-kz5-mk7","deleted_at":"2024-04-02T15:35:41.326918+00:00"}]}
string: '{"deleted_tests":[{"public_id":"59e-ema-ct7","deleted_at":"2024-05-30T13:32:58.958184+00:00"}]}

'
headers:
Expand Down
1 change: 1 addition & 0 deletions tests/v1/features/synthetics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ Feature: Synthetics
Then the response status is 200 OK - Returns the created test details.
And the response "name" is equal to "{{ unique }}"
And the response "config.request.files[0].name" is equal to "file name"
And the response "config.request.files[0].originalFileName" is equal to "image.png"
And the response "config.request.files[0].type" is equal to "file type"
And the response "config.request.files[0]" has field "bucketKey"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"bodyType": "application/octet-stream",
"files": [{
"name": "file name",
"originalFileName": "image.png",
"content": "file content",
"type": "file type"
}],
Expand Down
Loading