diff --git a/.apigentools-info b/.apigentools-info index 43cfb332689..e882d746bfa 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-12 17:39:25.538669", - "spec_repo_commit": "3cda457d" + "regenerated": "2024-02-14 10:08:29.613139", + "spec_repo_commit": "a17c645a" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-12 17:39:25.567065", - "spec_repo_commit": "3cda457d" + "regenerated": "2024-02-14 10:08:29.630354", + "spec_repo_commit": "a17c645a" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 99631ba18dc..c887fc9ec04 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -13213,10 +13213,12 @@ components: only supporting `http`. enum: - http + - grpc example: http type: string x-enum-varnames: - HTTP + - GRPC SyntheticsAPITest: description: Object containing details about a Synthetic API test. properties: diff --git a/api/datadogV1/model_synthetics_api_step_subtype.go b/api/datadogV1/model_synthetics_api_step_subtype.go index ee837514f34..3d8bbe32101 100644 --- a/api/datadogV1/model_synthetics_api_step_subtype.go +++ b/api/datadogV1/model_synthetics_api_step_subtype.go @@ -16,10 +16,12 @@ type SyntheticsAPIStepSubtype string // List of SyntheticsAPIStepSubtype. const ( SYNTHETICSAPISTEPSUBTYPE_HTTP SyntheticsAPIStepSubtype = "http" + SYNTHETICSAPISTEPSUBTYPE_GRPC SyntheticsAPIStepSubtype = "grpc" ) var allowedSyntheticsAPIStepSubtypeEnumValues = []SyntheticsAPIStepSubtype{ SYNTHETICSAPISTEPSUBTYPE_HTTP, + SYNTHETICSAPISTEPSUBTYPE_GRPC, } // GetAllowedValues reeturns the list of possible values. diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go b/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go index 9a99321e48a..dc76b5e26f9 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go @@ -58,6 +58,35 @@ func main() { }, Subtype: datadogV1.SYNTHETICSAPISTEPSUBTYPE_HTTP, }, + { + Name: "GRPC CALL", + Subtype: datadogV1.SYNTHETICSAPISTEPSUBTYPE_GRPC, + ExtractedValues: []datadogV1.SyntheticsParsingOptions{}, + AllowFailure: datadog.PtrBool(false), + IsCritical: datadog.PtrBool(true), + Retry: &datadogV1.SyntheticsTestOptionsRetry{ + Count: datadog.PtrInt64(0), + Interval: datadog.PtrFloat64(300), + }, + Assertions: []datadogV1.SyntheticsAssertion{ + datadogV1.SyntheticsAssertion{ + SyntheticsAssertionTarget: &datadogV1.SyntheticsAssertionTarget{ + Operator: datadogV1.SYNTHETICSASSERTIONOPERATOR_LESS_THAN, + Type: datadogV1.SYNTHETICSASSERTIONTYPE_RESPONSE_TIME, + Target: 1000, + }}, + }, + Request: datadogV1.SyntheticsTestRequest{ + Host: datadog.PtrString("grpcbin.test.k6.io"), + Port: datadog.PtrInt64(9000), + Service: datadog.PtrString("grpcbin.GRPCBin"), + Method: datadog.PtrString("Index"), + Message: datadog.PtrString("{}"), + CompressedJsonDescriptor: datadog.PtrString("eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g=="), + Metadata: map[string]string{}, + CallType: datadogV1.SYNTHETICSTESTCALLTYPE_UNARY.Ptr(), + }, + }, }, }, Locations: []string{ diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.freeze index d9857f82457..5a6248b6359 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.freeze @@ -1 +1 @@ -2024-01-26T10:20:27.109Z \ No newline at end of file +2024-02-14T09:56:55.385Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.yaml index eee26e0a7f8..ac1fb127aa7 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_a_global_variable_from_test_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"}]},"locations":["aws:us-east-2"],"message":"BDD test payload: synthetics_api_test_multi_step_payload.json","name":"Test-Create_a_global_variable_from_test_returns_OK_response-1706264427","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_a_global_variable_from_test_returns_OK_response-1706264427","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"subtype":"multi","tags":["testing:api"],"type":"api"} + {"config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"},{"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_a_global_variable_from_test_returns_OK_response-1707904615","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":1,"monitor_name":"Test-Create_a_global_variable_from_test_returns_OK_response-1707904615","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"subtype":"multi","tags":["testing:api"],"type":"api"} form: {} headers: Accept: @@ -12,9 +12,12 @@ interactions: method: POST url: https://api.datadoghq.com/api/v1/synthetics/tests/api response: - body: '{"public_id":"izb-9gc-92w","name":"Test-Create_a_global_variable_from_test_returns_OK_response-1706264427","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-01-26T10:20:27.717659+00:00","modified_at":"2024-01-26T10:20:27.717659+00:00","config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request - is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"79d-ysr-wwj"}]},"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_a_global_variable_from_test_returns_OK_response-1706264427","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"multi","created_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":138446065,"org_id":569509,"modified_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + body: '{"public_id":"6td-hmb-t6f","name":"Test-Create_a_global_variable_from_test_returns_OK_response-1707904615","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-02-14T09:56:55.729504+00:00","modified_at":"2024-02-14T09:56:55.729504+00:00","config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request + is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"7g9-x3d-mid"},{"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":"xnr-5zr-293"}]},"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_a_global_variable_from_test_returns_OK_response-1707904615","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"multi","created_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"},"deleted_at":null,"monitor_id":139518955,"org_id":321813,"modified_by":{"name":"CI + Account","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","email":"team-intg-tools-libs-spam@datadoghq.com"}}' code: 200 duration: 0ms headers: @@ -23,7 +26,7 @@ interactions: status: 200 OK - request: body: | - {"description":"","name":"GLOBAL_VARIABLE_PAYLOAD_TESTCREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE1706264427","parse_test_options":{"localVariableName":"EXTRACTED_VALUE","type":"local_variable"},"parse_test_public_id":"izb-9gc-92w","tags":[],"value":{"options":{"totp_parameters":{"digits":6,"refresh_interval":30}},"secure":false,"value":""}} + {"description":"","name":"GLOBAL_VARIABLE_PAYLOAD_TESTCREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE1707904615","parse_test_options":{"localVariableName":"EXTRACTED_VALUE","type":"local_variable"},"parse_test_public_id":"6td-hmb-t6f","tags":[],"value":{"options":{"totp_parameters":{"digits":6,"refresh_interval":30}},"secure":false,"value":""}} form: {} headers: Accept: @@ -34,7 +37,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v1/synthetics/variables response: - body: '{"id":"a586a64d-cd9f-4983-8d00-81dcefb919ac","name":"GLOBAL_VARIABLE_PAYLOAD_TESTCREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE1706264427","description":"","type":"variable","tags":[],"parse_test_public_id":"izb-9gc-92w","parse_test_name":null,"parse_test_options":{"localVariableName":"EXTRACTED_VALUE","type":"local_variable"},"parse_test_extracted_at":null,"is_totp":null,"is_fido":null,"last_error":null,"value":{"options":{"totp_parameters":{"digits":6,"refresh_interval":30}},"secure":false,"value":""}} + body: '{"id":"b8daafc5-09e1-4f63-9f44-c973b2ec57dc","name":"GLOBAL_VARIABLE_PAYLOAD_TESTCREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE1707904615","description":"","type":"variable","tags":[],"parse_test_public_id":"6td-hmb-t6f","parse_test_name":null,"parse_test_options":{"localVariableName":"EXTRACTED_VALUE","type":"local_variable"},"parse_test_extracted_at":null,"is_totp":null,"is_fido":null,"last_error":null,"value":{"options":{"totp_parameters":{"digits":6,"refresh_interval":30}},"secure":false,"value":""}} ' code: 200 @@ -51,7 +54,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v1/synthetics/variables/a586a64d-cd9f-4983-8d00-81dcefb919ac + url: https://api.datadoghq.com/api/v1/synthetics/variables/b8daafc5-09e1-4f63-9f44-c973b2ec57dc response: body: '' code: 200 @@ -62,7 +65,7 @@ interactions: status: 200 OK - request: body: | - {"public_ids":["izb-9gc-92w"]} + {"public_ids":["6td-hmb-t6f"]} form: {} headers: Accept: @@ -73,7 +76,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: - body: '{"deleted_tests":[{"public_id":"izb-9gc-92w","deleted_at":"2024-01-26T10:20:29.374347+00:00"}]} + body: '{"deleted_tests":[{"public_id":"6td-hmb-t6f","deleted_at":"2024-02-14T09:56:56.985642+00:00"}]} ' code: 200 diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.freeze b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.freeze index 8113d86f364..5786b386acd 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.freeze @@ -1 +1 @@ -2024-01-26T10:20:47.505Z \ No newline at end of file +2024-02-14T09:52:43.647Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.yaml b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.yaml index dae690e3500..78c3ef537ee 100644 --- a/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v1/Feature_Synthetics/Scenario_Create_an_API_test_with_multi_subtype_returns_OK_-_Returns_the_created_test_details._response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"}]},"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-1706264447","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-1706264447","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"subtype":"multi","tags":["testing:api"],"type":"api"} + {"config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http"},{"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-1707904363","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-1707904363","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"subtype":"multi","tags":["testing:api"],"type":"api"} form: {} headers: Accept: @@ -12,9 +12,10 @@ interactions: method: POST url: https://api.datadoghq.com/api/v1/synthetics/tests/api response: - body: '{"public_id":"gvd-8ek-8j4","name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1706264447","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-01-26T10:20:47.990304+00:00","modified_at":"2024-01-26T10:20:47.990304+00:00","config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request - is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"tj8-64v-kmn"}]},"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-1706264447","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"multi","created_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":138446072,"org_id":569509,"modified_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' + body: '{"public_id":"49h-gaa-dte","name":"Test-Create_an_API_test_with_multi_subtype_returns_OK_Returns_the_created_test_details_response-1707904363","status":"live","type":"api","tags":["testing:api"],"created_at":"2024-02-14T09:52:44.302597+00:00","modified_at":"2024-02-14T09:52:44.302597+00:00","config":{"configVariables":[{"example":"content-type","name":"PROPERTY","pattern":"content-type","type":"text"}],"steps":[{"allowFailure":true,"assertions":[{"operator":"is","target":200,"type":"statusCode"}],"extractedValues":[{"field":"server","name":"EXTRACTED_VALUE","parser":{"type":"raw"},"secure":true,"type":"http_header"}],"isCritical":true,"name":"request + is sent","request":{"method":"GET","timeout":10,"url":"https://datadoghq.com"},"retry":{"count":5,"interval":1000},"subtype":"http","id":"nt6-mfm-kis"},{"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":"ksz-bri-vu5"}]},"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-1707904363","monitor_priority":5,"retry":{"count":3,"interval":1000},"tick_every":60},"locations":["aws:us-east-2"],"subtype":"multi","created_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"},"deleted_at":null,"monitor_id":139518783,"org_id":569509,"modified_by":{"name":"Frog","handle":"frog@datadoghq.com","email":"frog@datadoghq.com"}}' code: 200 duration: 0ms headers: @@ -23,7 +24,7 @@ interactions: status: 200 OK - request: body: | - {"public_ids":["gvd-8ek-8j4"]} + {"public_ids":["49h-gaa-dte"]} form: {} headers: Accept: @@ -34,7 +35,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v1/synthetics/tests/delete response: - body: '{"deleted_tests":[{"public_id":"gvd-8ek-8j4","deleted_at":"2024-01-26T10:20:48.529333+00:00"}]} + body: '{"deleted_tests":[{"public_id":"49h-gaa-dte","deleted_at":"2024-02-14T09:52:44.978031+00:00"}]} ' code: 200 diff --git a/tests/scenarios/features/v1/given.json b/tests/scenarios/features/v1/given.json index 205b1ecb2f1..6ba2f4e62d0 100644 --- a/tests/scenarios/features/v1/given.json +++ b/tests/scenarios/features/v1/given.json @@ -250,7 +250,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"config\": {\n \"configVariables\": [\n {\n \"example\": \"content-type\",\n \"name\": \"PROPERTY\",\n \"pattern\": \"content-type\",\n \"type\": \"text\"\n }\n ],\n \"steps\": [\n {\n \"allowFailure\": true,\n \"assertions\": [\n {\n \"operator\": \"is\",\n \"type\": \"statusCode\",\n \"target\": 200\n }\n ],\n \"extractedValues\": [\n {\n \"field\": \"server\",\n \"name\": \"EXTRACTED_VALUE\",\n \"parser\": {\n \"type\": \"raw\"\n },\n \"type\": \"http_header\",\n \"secure\": true\n }\n ],\n \"isCritical\": true,\n \"name\": \"request is sent\",\n \"request\": {\n \"method\": \"GET\",\n \"timeout\": 10,\n \"url\": \"https://datadoghq.com\"\n },\n \"retry\": {\n \"count\": 5,\n \"interval\": 1000\n },\n \"subtype\": \"http\"\n }\n ]\n },\n \"locations\": [\"aws:us-east-2\"],\n \"message\": \"BDD test payload: synthetics_api_test_multi_step_payload.json\",\n \"name\": \"{{ unique }}\",\n \"options\": {\n \"accept_self_signed\": false,\n \"allow_insecure\": true,\n \"follow_redirects\": true,\n \"min_failure_duration\": 10,\n \"min_location_failed\": 1,\n \"monitor_name\": \"{{ unique }}\",\n \"monitor_priority\": 5,\n \"retry\": { \"count\": 3, \"interval\": 1000 },\n \"tick_every\": 60\n },\n \"subtype\": \"multi\",\n \"tags\": [\"testing:api\"],\n \"type\": \"api\"\n}\n" + "value": "{\n \"config\": {\n \"configVariables\": [\n {\n \"example\": \"content-type\",\n \"name\": \"PROPERTY\",\n \"pattern\": \"content-type\",\n \"type\": \"text\"\n }\n ],\n \"steps\": [\n {\n \"allowFailure\": true,\n \"assertions\": [\n {\n \"operator\": \"is\",\n \"type\": \"statusCode\",\n \"target\": 200\n }\n ],\n \"extractedValues\": [\n {\n \"field\": \"server\",\n \"name\": \"EXTRACTED_VALUE\",\n \"parser\": {\n \"type\": \"raw\"\n },\n \"type\": \"http_header\",\n \"secure\": true\n }\n ],\n \"isCritical\": true,\n \"name\": \"request is sent\",\n \"request\": {\n \"method\": \"GET\",\n \"timeout\": 10,\n \"url\": \"https://datadoghq.com\"\n },\n \"retry\": {\n \"count\": 5,\n \"interval\": 1000\n },\n \"subtype\": \"http\"\n },\n {\n \"name\": \"GRPC CALL\",\n \"subtype\": \"grpc\",\n \"extractedValues\": [],\n \"allowFailure\": false,\n \"isCritical\": true,\n \"retry\": {\n \"count\": 0,\n \"interval\": 300\n },\n \"assertions\": [\n {\n \"operator\": \"lessThan\",\n \"type\": \"responseTime\",\n \"target\": 1000\n }\n ],\n \"request\": {\n \"host\": \"grpcbin.test.k6.io\",\n \"port\": 9000,\n \"service\": \"grpcbin.GRPCBin\",\n \"method\": \"Index\",\n \"message\": \"{}\",\n \"compressedJsonDescriptor\": \"eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==\",\n \"metadata\": {},\n \"callType\": \"unary\"\n }\n }\n ]\n },\n \"locations\": [\"aws:us-east-2\"],\n \"message\": \"BDD test payload: synthetics_api_test_multi_step_payload.json\",\n \"name\": \"{{ unique }}\",\n \"options\": {\n \"accept_self_signed\": false,\n \"allow_insecure\": true,\n \"follow_redirects\": true,\n \"min_failure_duration\": 10,\n \"min_location_failed\": 1,\n \"monitor_name\": \"{{ unique }}\",\n \"monitor_priority\": 5,\n \"retry\": { \"count\": 3, \"interval\": 1000 },\n \"tick_every\": 60\n },\n \"subtype\": \"multi\",\n \"tags\": [\"testing:api\"],\n \"type\": \"api\"\n}\n" } ], "step": "there is a valid \"synthetics_api_test_multi_step\" in the system", diff --git a/tests/scenarios/features/v1/synthetics.feature b/tests/scenarios/features/v1/synthetics.feature index 9b9722550cc..36f74743154 100644 --- a/tests/scenarios/features/v1/synthetics.feature +++ b/tests/scenarios/features/v1/synthetics.feature @@ -203,6 +203,7 @@ Feature: Synthetics And the response "config.steps[0].retry.count" is equal to 5 And the response "config.steps[0].retry.interval" is equal to 1000 And the response "config.steps[0].extractedValues[0].secure" is equal to true + And the response "config.steps[1].request.host" is equal to "grpcbin.test.k6.io" @generated @skip @team:DataDog/synthetics-app Scenario: Delete a global variable returns "JSON format is wrong" response diff --git a/tests/scenarios/features/v1/synthetics_api_test_multi_step_payload.json b/tests/scenarios/features/v1/synthetics_api_test_multi_step_payload.json index f514958caa2..28778436156 100644 --- a/tests/scenarios/features/v1/synthetics_api_test_multi_step_payload.json +++ b/tests/scenarios/features/v1/synthetics_api_test_multi_step_payload.json @@ -41,6 +41,34 @@ "interval": 1000 }, "subtype": "http" + }, + { + "name": "GRPC CALL", + "subtype": "grpc", + "extractedValues": [], + "allowFailure": false, + "isCritical": true, + "retry": { + "count": 0, + "interval": 300 + }, + "assertions": [ + { + "operator": "lessThan", + "type": "responseTime", + "target": 1000 + } + ], + "request": { + "host": "grpcbin.test.k6.io", + "port": 9000, + "service": "grpcbin.GRPCBin", + "method": "Index", + "message": "{}", + "compressedJsonDescriptor": "eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==", + "metadata": {}, + "callType": "unary" + } } ] },