diff --git a/integration/hurl/tests_failed/assert_match_utf8.out.pattern b/integration/hurl/tests_failed/assert_match_utf8.out.pattern index 3e26e29f2e1..b9599b7411c 100644 --- a/integration/hurl/tests_failed/assert_match_utf8.out.pattern +++ b/integration/hurl/tests_failed/assert_match_utf8.out.pattern @@ -1 +1 @@ -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Invalid decoding\n --> tests_failed/assert_match_utf8.hurl:4:1\n |\n | GET http://localhost:8000/error-assert/match-utf8\n | ...\n 4 | body matches \".*\"\n | ^^^^ the body can not be decoded with charset 'utf-8'\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-assert/match-utf8"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"1"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/assert_match_utf8.hurl","success":false,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Invalid decoding\n --> tests_failed/assert_match_utf8.hurl:4:1\n |\n | GET http://localhost:8000/error-assert/match-utf8\n | ...\n 4 | body matches \".*\"\n | ^^^^ the body can not be decoded with charset 'utf-8'\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-assert/match-utf8"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"1"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/error-assert/match-utf8'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/assert_match_utf8.hurl","success":false,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_failed/assert_status.out.pattern b/integration/hurl/tests_failed/assert_status.out.pattern index 38073ebc6eb..fb381e18265 100644 --- a/integration/hurl/tests_failed/assert_status.out.pattern +++ b/integration/hurl/tests_failed/assert_status.out.pattern @@ -1 +1 @@ -{"cookies":[],"entries":[{"asserts":[{"line":9,"success":true},{"line":9,"message":"Assert status code\n --> tests_failed/assert_status.hurl:9:6\n |\n | GET http://localhost:8000/not_found\n | ...\n 9 | HTTP 200\n | ^^^ actual value is <404>\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/not_found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"207"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":404},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":7,"time":<<<\d+>>>}],"filename":"tests_failed/assert_status.hurl","success":false,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":9,"success":true},{"line":9,"message":"Assert status code\n --> tests_failed/assert_status.hurl:9:6\n |\n | GET http://localhost:8000/not_found\n | ...\n 9 | HTTP 200\n | ^^^ actual value is <404>\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/not_found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"207"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":404},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/not_found'","index":1,"line":7,"time":<<<\d+>>>}],"filename":"tests_failed/assert_status.hurl","success":false,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_failed/assert_template_variable_not_found.out.pattern b/integration/hurl/tests_failed/assert_template_variable_not_found.out.pattern index 6c040090c74..48b08d1fd92 100644 --- a/integration/hurl/tests_failed/assert_template_variable_not_found.out.pattern +++ b/integration/hurl/tests_failed/assert_template_variable_not_found.out.pattern @@ -1 +1 @@ -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Undefined variable\n --> tests_failed/assert_template_variable_not_found.hurl:4:29\n |\n | GET http://localhost:8000/error-assert-template-variable-not-found\n | ...\n 4 | header \"content-type\" == \"{{content_type}}\"\n | ^^^^^^^^^^^^ you must set the variable content_type\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-assert-template-variable-not-found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/assert_template_variable_not_found.hurl","success":false,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Undefined variable\n --> tests_failed/assert_template_variable_not_found.hurl:4:29\n |\n | GET http://localhost:8000/error-assert-template-variable-not-found\n | ...\n 4 | header \"content-type\" == \"{{content_type}}\"\n | ^^^^^^^^^^^^ you must set the variable content_type\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-assert-template-variable-not-found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/error-assert-template-variable-not-found'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/assert_template_variable_not_found.hurl","success":false,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_failed/assert_template_variable_not_found.ps1 b/integration/hurl/tests_failed/assert_template_variable_not_found.ps1 index b1b776075d7..68d1deafebe 100644 --- a/integration/hurl/tests_failed/assert_template_variable_not_found.ps1 +++ b/integration/hurl/tests_failed/assert_template_variable_not_found.ps1 @@ -1,3 +1,4 @@ Set-StrictMode -Version latest $ErrorActionPreference = 'Stop' + hurl --json tests_failed/assert_template_variable_not_found.hurl diff --git a/integration/hurl/tests_failed/assert_template_variable_not_found.sh b/integration/hurl/tests_failed/assert_template_variable_not_found.sh index f3f9778351e..e501d685e6b 100755 --- a/integration/hurl/tests_failed/assert_template_variable_not_found.sh +++ b/integration/hurl/tests_failed/assert_template_variable_not_found.sh @@ -1,3 +1,4 @@ #!/bin/bash set -Eeuo pipefail + hurl --json tests_failed/assert_template_variable_not_found.hurl diff --git a/integration/hurl/tests_failed/assert_value_error.out.pattern b/integration/hurl/tests_failed/assert_value_error.out.pattern index 5df7bd79226..38bf2cda946 100644 --- a/integration/hurl/tests_failed/assert_value_error.out.pattern +++ b/integration/hurl/tests_failed/assert_value_error.out.pattern @@ -84,7 +84,7 @@ "headers": [ { "name": "Server", - "value": "Werkzeug/<<<.*?>>>" + "value": "Werkzeug/<<<.*?>>> Python/<<<.*?>>>" }, { "name": "Date", @@ -123,6 +123,7 @@ } ], "captures": [], + "curl_cmd": "curl 'http://localhost:8000/error-assert-value'", "index": 1, "line": 1, "time": <<<\d+>>> diff --git a/integration/hurl/tests_failed/query_header_not_found.out.pattern b/integration/hurl/tests_failed/query_header_not_found.out.pattern index fd3e2e1de03..fd332988cb8 100644 --- a/integration/hurl/tests_failed/query_header_not_found.out.pattern +++ b/integration/hurl/tests_failed/query_header_not_found.out.pattern @@ -1 +1 @@ -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"message":"Header not found\n --> tests_failed/query_header_not_found.hurl:3:1\n |\n | GET http://localhost:8000/error-query-header-not-found\n | ...\n 3 | Custom: XXX\n | ^^^^^^ this header has not been found in the response\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-query-header-not-found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/query_header_not_found.hurl","success":false,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"message":"Header not found\n --> tests_failed/query_header_not_found.hurl:3:1\n |\n | GET http://localhost:8000/error-query-header-not-found\n | ...\n 3 | Custom: XXX\n | ^^^^^^ this header has not been found in the response\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-query-header-not-found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/error-query-header-not-found'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/query_header_not_found.hurl","success":false,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_ok/assert_header.out.pattern b/integration/hurl/tests_ok/assert_header.out.pattern index c1a014c53e7..1eee9ea099a 100644 --- a/integration/hurl/tests_ok/assert_header.out.pattern +++ b/integration/hurl/tests_ok/assert_header.out.pattern @@ -1 +1 @@ -{"cookies":[{"domain":"localhost","expires":"<<<\d+>>>","https":"FALSE","include_subdomain":"FALSE","name":"cookie1","path":"/","value":"value1"},{"domain":"localhost","expires":"<<<\d+>>>","https":"FALSE","include_subdomain":"FALSE","name":"cookie2","path":"/","value":"value2"},{"domain":"localhost","expires":"<<<\d+>>>","https":"FALSE","include_subdomain":"FALSE","name":"cookie3","path":"/","value":"value3"}],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true},{"line":4,"success":true},{"line":5,"success":true},{"line":7,"success":true},{"line":8,"success":true},{"line":9,"success":true},{"line":10,"success":true},{"line":11,"success":true},{"line":12,"success":true},{"line":13,"success":true},{"line":14,"success":true},{"line":15,"success":true},{"line":16,"success":true},{"line":17,"success":true},{"line":18,"success":true},{"line":19,"success":true},{"line":20,"success":true},{"line":21,"success":true},{"line":22,"success":true},{"line":23,"success":true},{"line":24,"success":true},{"line":25,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/assert-header"},"response":{"cookies":[{"name":"cookie1","path":"/","value":"value1"},{"name":"cookie2","path":"/","value":"value2"},{"name":"cookie3","path":"/","value":"value3"}],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Header1","value":"value1"},{"name":"ETag","value":"\"33a64df551425fcc55e4d42a148795d9f25f89d4\""},{"name":"Expires","value":"<<<.*?>>>"},{"name":"x-fruit","value":"Banana"},{"name":"x-fruit","value":"Lemon"},{"name":"x-fruit","value":"Grape"},{"name":"x-fruit","value":"Strawberry"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Set-Cookie","value":"cookie1=value1; Path=/"},{"name":"Set-Cookie","value":"cookie2=value2; Path=/"},{"name":"Set-Cookie","value":"cookie3=value3; Path=/"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>},{"asserts":[{"line":31,"success":true},{"line":31,"success":true},{"line":35,"success":true},{"line":36,"success":true},{"line":37,"success":true},{"line":38,"success":true},{"line":39,"success":true}],"calls":[{"request":{"cookies":[{"name":"cookie3","value":"value3"},{"name":"cookie2","value":"value2"},{"name":"cookie1","value":"value1"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"Cookie","value":"cookie3=value3; cookie2=value2; cookie1=value1"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/assert-header"},"response":{"cookies":[{"name":"cookie1","path":"/","value":"value1"},{"name":"cookie2","path":"/","value":"value2"},{"name":"cookie3","path":"/","value":"value3"}],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Header1","value":"value1"},{"name":"ETag","value":"\"33a64df551425fcc55e4d42a148795d9f25f89d4\""},{"name":"Expires","value":"<<<.*?>>>"},{"name":"x-fruit","value":"Banana"},{"name":"x-fruit","value":"Lemon"},{"name":"x-fruit","value":"Grape"},{"name":"x-fruit","value":"Strawberry"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Set-Cookie","value":"cookie1=value1; Path=/"},{"name":"Set-Cookie","value":"cookie2=value2; Path=/"},{"name":"Set-Cookie","value":"cookie3=value3; Path=/"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"fruits","value":["Banana","Lemon","Grape","Strawberry"]}],"index":2,"line":30,"time":<<<\d+>>>}],"filename":"tests_ok/assert_header.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[{"domain":"localhost","expires":"<<<\d+>>>","https":"FALSE","include_subdomain":"FALSE","name":"cookie1","path":"/","value":"value1"},{"domain":"localhost","expires":"<<<\d+>>>","https":"FALSE","include_subdomain":"FALSE","name":"cookie2","path":"/","value":"value2"},{"domain":"localhost","expires":"<<<\d+>>>","https":"FALSE","include_subdomain":"FALSE","name":"cookie3","path":"/","value":"value3"}],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true},{"line":4,"success":true},{"line":5,"success":true},{"line":7,"success":true},{"line":8,"success":true},{"line":9,"success":true},{"line":10,"success":true},{"line":11,"success":true},{"line":12,"success":true},{"line":13,"success":true},{"line":14,"success":true},{"line":15,"success":true},{"line":16,"success":true},{"line":17,"success":true},{"line":18,"success":true},{"line":19,"success":true},{"line":20,"success":true},{"line":21,"success":true},{"line":22,"success":true},{"line":23,"success":true},{"line":24,"success":true},{"line":25,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/assert-header"},"response":{"cookies":[{"name":"cookie1","path":"/","value":"value1"},{"name":"cookie2","path":"/","value":"value2"},{"name":"cookie3","path":"/","value":"value3"}],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Header1","value":"value1"},{"name":"ETag","value":"\"33a64df551425fcc55e4d42a148795d9f25f89d4\""},{"name":"Expires","value":"<<<.*?>>>"},{"name":"x-fruit","value":"Banana"},{"name":"x-fruit","value":"Lemon"},{"name":"x-fruit","value":"Grape"},{"name":"x-fruit","value":"Strawberry"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Set-Cookie","value":"cookie1=value1; Path=/"},{"name":"Set-Cookie","value":"cookie2=value2; Path=/"},{"name":"Set-Cookie","value":"cookie3=value3; Path=/"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/assert-header'","index":1,"line":1,"time":<<<\d+>>>},{"asserts":[{"line":31,"success":true},{"line":31,"success":true},{"line":35,"success":true},{"line":36,"success":true},{"line":37,"success":true},{"line":38,"success":true},{"line":39,"success":true}],"calls":[{"request":{"cookies":[{"name":"cookie3","value":"value3"},{"name":"cookie2","value":"value2"},{"name":"cookie1","value":"value1"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"Cookie","value":"cookie3=value3; cookie2=value2; cookie1=value1"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/assert-header"},"response":{"cookies":[{"name":"cookie1","path":"/","value":"value1"},{"name":"cookie2","path":"/","value":"value2"},{"name":"cookie3","path":"/","value":"value3"}],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Header1","value":"value1"},{"name":"ETag","value":"\"33a64df551425fcc55e4d42a148795d9f25f89d4\""},{"name":"Expires","value":"<<<.*?>>>"},{"name":"x-fruit","value":"Banana"},{"name":"x-fruit","value":"Lemon"},{"name":"x-fruit","value":"Grape"},{"name":"x-fruit","value":"Strawberry"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Set-Cookie","value":"cookie1=value1; Path=/"},{"name":"Set-Cookie","value":"cookie2=value2; Path=/"},{"name":"Set-Cookie","value":"cookie3=value3; Path=/"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"fruits","value":["Banana","Lemon","Grape","Strawberry"]}],"curl_cmd":"curl --cookie 'cookie1=value1; cookie2=value2; cookie3=value3' 'http://localhost:8000/assert-header'","index":2,"line":30,"time":<<<\d+>>>}],"filename":"tests_ok/assert_header.hurl","success":true,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_ok/assert_header.ps1 b/integration/hurl/tests_ok/assert_header.ps1 index d9d87568251..ba1de0cec9e 100644 --- a/integration/hurl/tests_ok/assert_header.ps1 +++ b/integration/hurl/tests_ok/assert_header.ps1 @@ -1,3 +1,4 @@ Set-StrictMode -Version latest $ErrorActionPreference = 'Stop' + hurl --json --verbose tests_ok/assert_header.hurl diff --git a/integration/hurl/tests_ok/assert_header.sh b/integration/hurl/tests_ok/assert_header.sh index 5100c9daba3..39c65e1f984 100755 --- a/integration/hurl/tests_ok/assert_header.sh +++ b/integration/hurl/tests_ok/assert_header.sh @@ -1,3 +1,4 @@ #!/bin/bash set -Eeuo pipefail + hurl --json --verbose tests_ok/assert_header.hurl diff --git a/integration/hurl/tests_ok/captures_to_json.out.pattern b/integration/hurl/tests_ok/captures_to_json.out.pattern index a936e8f76f9..ca9057434ae 100644 --- a/integration/hurl/tests_ok/captures_to_json.out.pattern +++ b/integration/hurl/tests_ok/captures_to_json.out.pattern @@ -1 +1 @@ -{"cookies":[{"domain":".localhost","expires":"<<<\d+>>>","https":"FALSE","include_subdomain":"TRUE","name":"foo","path":"/bar","value":"value1"}],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":12,"success":true},{"line":13,"success":true},{"line":14,"success":true},{"line":15,"success":true},{"line":16,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/captures"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Header1","value":"value1"},{"name":"Header2","value":"Hello Bob!"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"param1","value":"value1"},{"name":"param2","value":"Bob"},{"name":"param3","value":"Bob"},{"name":"data1","value":"Hello world!"},{"name":"data2","value":"Hello world!"}],"index":1,"line":1,"time":<<<\d+>>>},{"asserts":[{"line":23,"success":true},{"line":23,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"param1","value":"value1"},{"name":"param2","value":"Bob"}],"url":"http://localhost:8000/captures-check?param1=value1¶m2=Bob"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":19,"time":<<<\d+>>>},{"asserts":[{"line":30,"success":true},{"line":30,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"param1","value":"value1"},{"name":"param2","value":"Bob"}],"url":"http://localhost:8000/captures-check?param1=value1¶m2=Bob"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":3,"line":26,"time":<<<\d+>>>},{"asserts":[{"line":34,"success":true},{"line":34,"success":true},{"line":38,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/captures-xml"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"166"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"a_node_set","value":{"size":2,"type":"nodeset"}}],"index":4,"line":33,"time":<<<\d+>>>},{"asserts":[{"line":42,"success":true},{"line":42,"success":true},{"line":51,"success":true},{"line":52,"success":true},{"line":53,"success":true},{"line":54,"success":true},{"line":55,"success":true},{"line":56,"success":true},{"line":57,"success":true},{"line":58,"success":true},{"line":59,"success":true},{"line":60,"success":true},{"line":61,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/captures-cookie"},"response":{"cookies":[{"domain":"localhost","expires":"<<<.*?>>>","httponly":true,"max_age":"2592000","name":"foo","path":"/bar","value":"value1"}],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Set-Cookie","value":"foo=value1; Domain=localhost; Expires=<<<.*?>>>; Max-Age=2592000; HttpOnly; Path=/bar"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"a_cookie_value_attr","value":"value1"},{"name":"a_cookie_path_attr","value":"/bar"},{"name":"a_cookie_expires_attr","value":"2078-01-13 22:23:01 UTC"},{"name":"a_cookie_domain_attr","value":"localhost"},{"name":"a_cookie_max_age_attr","value":2592000},{"name":"a_cookie_http_only_attr","value":{"type":"unit"}}],"index":5,"line":41,"time":<<<\d+>>>},{"asserts":[{"line":66,"success":true},{"line":66,"success":true},{"line":81,"success":true},{"line":82,"success":true},{"line":83,"success":true},{"line":84,"success":true},{"line":85,"success":true},{"line":86,"success":true},{"line":87,"success":true},{"line":88,"success":true},{"line":89,"success":true},{"line":90,"success":true},{"line":91,"success":true},{"line":92,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/captures-json"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"205"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"an_object","value":{"id":"123"}},{"name":"a_list","value":[1,2,3]},{"name":"a_null","value":null},{"name":"an_integer","value":1},{"name":"a_big_integer","value":10000000000000000365},{"name":"a_float","value":1.1},{"name":"a_bool","value":true},{"name":"a_string","value":"hello"},{"name":"a_date_like_string","value":"2012-04-23T18:25:43.511Z"},{"name":"a_date","value":"2012-04-23 18:25:43.511 UTC"},{"name":"some_bytes","value":"eyJhX251bGwiOm51bGwsImFuX29iamVjdCI6eyJpZCI6ICIxMjMifSwiYV9saXN0IjpbMSwyLDNdLCJhbl9pbnRlZ2VyIjoxLCJhX2JpZ19pbnRlZ2VyIjoxMDAwMDAwMDAwMDAwMDAwMDM2NSwiYV9mbG9hdCI6MS4xLCJhX2Jvb2wiOnRydWUsImFfc3RyaW5nIjoiaGVsbG8iLCJhX2RhdGVfbGlrZV9zdHJpbmciOiIyMDEyLTA0LTIzVDE4OjI1OjQzLjUxMVoifQ=="},{"name":"all","value":{"a_big_integer":10000000000000000365,"a_bool":true,"a_date_like_string":"2012-04-23T18:25:43.511Z","a_float":1.1,"a_list":[1,2,3],"a_null":null,"a_string":"hello","an_integer":1,"an_object":{"id":"123"}}}],"index":6,"line":65,"time":<<<\d+>>>}],"filename":"tests_ok/captures.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[{"domain":".localhost","expires":"<<<\d+>>>","https":"FALSE","include_subdomain":"TRUE","name":"foo","path":"/bar","value":"value1"}],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":12,"success":true},{"line":13,"success":true},{"line":14,"success":true},{"line":15,"success":true},{"line":16,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/captures"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Header1","value":"value1"},{"name":"Header2","value":"Hello Bob!"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"param1","value":"value1"},{"name":"param2","value":"Bob"},{"name":"param3","value":"Bob"},{"name":"data1","value":"Hello world!"},{"name":"data2","value":"Hello world!"}],"curl_cmd":"curl 'http://localhost:8000/captures'","index":1,"line":1,"time":<<<\d+>>>},{"asserts":[{"line":23,"success":true},{"line":23,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"param1","value":"value1"},{"name":"param2","value":"Bob"}],"url":"http://localhost:8000/captures-check?param1=value1¶m2=Bob"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/captures-check?param1=value1¶m2=Bob'","index":2,"line":19,"time":<<<\d+>>>},{"asserts":[{"line":30,"success":true},{"line":30,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"param1","value":"value1"},{"name":"param2","value":"Bob"}],"url":"http://localhost:8000/captures-check?param1=value1¶m2=Bob"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/captures-check?param1=value1¶m2=Bob'","index":3,"line":26,"time":<<<\d+>>>},{"asserts":[{"line":34,"success":true},{"line":34,"success":true},{"line":38,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/captures-xml"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"166"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"a_node_set","value":{"size":2,"type":"nodeset"}}],"curl_cmd":"curl 'http://localhost:8000/captures-xml'","index":4,"line":33,"time":<<<\d+>>>},{"asserts":[{"line":42,"success":true},{"line":42,"success":true},{"line":51,"success":true},{"line":52,"success":true},{"line":53,"success":true},{"line":54,"success":true},{"line":55,"success":true},{"line":56,"success":true},{"line":57,"success":true},{"line":58,"success":true},{"line":59,"success":true},{"line":60,"success":true},{"line":61,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/captures-cookie"},"response":{"cookies":[{"domain":"localhost","expires":"<<<.*?>>>","httponly":true,"max_age":"2592000","name":"foo","path":"/bar","value":"value1"}],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Set-Cookie","value":"foo=value1; Domain=localhost; Expires=<<<.*?>>>; Max-Age=2592000; HttpOnly; Path=/bar"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"a_cookie_value_attr","value":"value1"},{"name":"a_cookie_path_attr","value":"/bar"},{"name":"a_cookie_expires_attr","value":"2078-01-13 22:23:01 UTC"},{"name":"a_cookie_domain_attr","value":"localhost"},{"name":"a_cookie_max_age_attr","value":2592000},{"name":"a_cookie_http_only_attr","value":{"type":"unit"}}],"curl_cmd":"curl 'http://localhost:8000/captures-cookie'","index":5,"line":41,"time":<<<\d+>>>},{"asserts":[{"line":66,"success":true},{"line":66,"success":true},{"line":81,"success":true},{"line":82,"success":true},{"line":83,"success":true},{"line":84,"success":true},{"line":85,"success":true},{"line":86,"success":true},{"line":87,"success":true},{"line":88,"success":true},{"line":89,"success":true},{"line":90,"success":true},{"line":91,"success":true},{"line":92,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/captures-json"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"205"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"an_object","value":{"id":"123"}},{"name":"a_list","value":[1,2,3]},{"name":"a_null","value":null},{"name":"an_integer","value":1},{"name":"a_big_integer","value":10000000000000000365},{"name":"a_float","value":1.1},{"name":"a_bool","value":true},{"name":"a_string","value":"hello"},{"name":"a_date_like_string","value":"2012-04-23T18:25:43.511Z"},{"name":"a_date","value":"2012-04-23 18:25:43.511 UTC"},{"name":"some_bytes","value":"eyJhX251bGwiOm51bGwsImFuX29iamVjdCI6eyJpZCI6ICIxMjMifSwiYV9saXN0IjpbMSwyLDNdLCJhbl9pbnRlZ2VyIjoxLCJhX2JpZ19pbnRlZ2VyIjoxMDAwMDAwMDAwMDAwMDAwMDM2NSwiYV9mbG9hdCI6MS4xLCJhX2Jvb2wiOnRydWUsImFfc3RyaW5nIjoiaGVsbG8iLCJhX2RhdGVfbGlrZV9zdHJpbmciOiIyMDEyLTA0LTIzVDE4OjI1OjQzLjUxMVoifQ=="},{"name":"all","value":{"a_big_integer":10000000000000000365,"a_bool":true,"a_date_like_string":"2012-04-23T18:25:43.511Z","a_float":1.1,"a_list":[1,2,3],"a_null":null,"a_string":"hello","an_integer":1,"an_object":{"id":"123"}}}],"curl_cmd":"curl 'http://localhost:8000/captures-json'","index":6,"line":65,"time":<<<\d+>>>}],"filename":"tests_ok/captures.hurl","success":true,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_ok/json_output.out.pattern b/integration/hurl/tests_ok/json_output.out.pattern index 12bc7d43adf..cd9f3e30df2 100644 --- a/integration/hurl/tests_ok/json_output.out.pattern +++ b/integration/hurl/tests_ok/json_output.out.pattern @@ -1 +1 @@ -{"cookies":[{"domain":"localhost","expires":"<<<\d+>>>","https":"FALSE","include_subdomain":"FALSE","name":"cookie2","path":"/","value":"valueA"}],"entries":[{"asserts":[{"line":7,"success":true},{"line":7,"success":true},{"line":8,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/hello"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":6,"time":<<<\d+>>>},{"asserts":[{"line":13,"success":true},{"line":13,"success":true},{"line":15,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/cookies/set-session-cookie2-valueA"},"response":{"cookies":[{"name":"cookie2","path":"/","value":"valueA"}],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Set-Cookie","value":"cookie2=valueA; Path=/"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":12,"time":<<<\d+>>>},{"asserts":[{"line":21,"success":true},{"line":21,"success":true},{"line":23,"success":true}],"calls":[{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"Accept","value":"text/plain"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/follow-redirect"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"267"},{"name":"Location","value":"http://localhost:8000/following-redirect"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":302},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":3,"line":19,"time":<<<\d+>>>},{"asserts":[{"line":31,"success":true},{"line":31,"success":true},{"line":34,"success":true},{"line":33,"success":true}],"calls":[{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"Accept","value":"text/plain"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/follow-redirect"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"267"},{"name":"Location","value":"http://localhost:8000/following-redirect"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":302},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}},{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"Accept","value":"text/plain"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/following-redirect"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"70"},{"name":"Location","value":"http://localhost:8000/followed-redirect"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":302},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}},{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"Accept","value":"text/plain"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/followed-redirect"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"18"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":4,"line":27,"time":<<<\d+>>>},{"asserts":[{"line":39,"success":true},{"line":39,"success":true}],"calls":[{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/captures"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Header1","value":"value1"},{"name":"Header2","value":"Hello Bob!"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"param1","value":"value1"},{"name":"param2","value":"Bob"},{"name":"param3","value":"Bob"},{"name":"data1","value":"Hello world!"},{"name":"data2","value":"Hello world!"}],"index":5,"line":38,"time":<<<\d+>>>},{"asserts":[{"line":50,"success":true},{"line":50,"success":true},{"line":52,"success":true},{"line":53,"success":true},{"line":54,"success":true},{"line":55,"success":true}],"calls":[{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/assert-json"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"357"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":6,"line":49,"time":<<<\d+>>>}],"filename":"tests_ok/json_output.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[{"domain":"localhost","expires":"<<<\d+>>>","https":"FALSE","include_subdomain":"FALSE","name":"cookie2","path":"/","value":"valueA"}],"entries":[{"asserts":[{"line":7,"success":true},{"line":7,"success":true},{"line":8,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/hello"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/hello'","index":1,"line":6,"time":<<<\d+>>>},{"asserts":[{"line":13,"success":true},{"line":13,"success":true},{"line":15,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/cookies/set-session-cookie2-valueA"},"response":{"cookies":[{"name":"cookie2","path":"/","value":"valueA"}],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Set-Cookie","value":"cookie2=valueA; Path=/"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/cookies/set-session-cookie2-valueA'","index":2,"line":12,"time":<<<\d+>>>},{"asserts":[{"line":21,"success":true},{"line":21,"success":true},{"line":23,"success":true}],"calls":[{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"Accept","value":"text/plain"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/follow-redirect"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"267"},{"name":"Location","value":"http://localhost:8000/following-redirect"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":302},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl --header 'Accept: text/plain' --cookie 'cookie2=valueA' 'http://localhost:8000/follow-redirect'","index":3,"line":19,"time":<<<\d+>>>},{"asserts":[{"line":31,"success":true},{"line":31,"success":true},{"line":34,"success":true},{"line":33,"success":true}],"calls":[{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"Accept","value":"text/plain"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/follow-redirect"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"267"},{"name":"Location","value":"http://localhost:8000/following-redirect"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":302},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}},{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"Accept","value":"text/plain"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/following-redirect"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"70"},{"name":"Location","value":"http://localhost:8000/followed-redirect"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":302},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}},{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"Accept","value":"text/plain"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/followed-redirect"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"18"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl --header 'Accept: text/plain' --cookie 'cookie2=valueA' --location 'http://localhost:8000/follow-redirect'","index":4,"line":27,"time":<<<\d+>>>},{"asserts":[{"line":39,"success":true},{"line":39,"success":true}],"calls":[{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/captures"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Header1","value":"value1"},{"name":"Header2","value":"Hello Bob!"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"param1","value":"value1"},{"name":"param2","value":"Bob"},{"name":"param3","value":"Bob"},{"name":"data1","value":"Hello world!"},{"name":"data2","value":"Hello world!"}],"curl_cmd":"curl --cookie 'cookie2=valueA' 'http://localhost:8000/captures'","index":5,"line":38,"time":<<<\d+>>>},{"asserts":[{"line":50,"success":true},{"line":50,"success":true},{"line":52,"success":true},{"line":53,"success":true},{"line":54,"success":true},{"line":55,"success":true}],"calls":[{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/assert-json"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"357"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl --cookie 'cookie2=valueA' 'http://localhost:8000/assert-json'","index":6,"line":49,"time":<<<\d+>>>}],"filename":"tests_ok/json_output.hurl","success":true,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_ok/json_output.ps1 b/integration/hurl/tests_ok/json_output.ps1 index 9a60f206867..5feb75c8293 100644 --- a/integration/hurl/tests_ok/json_output.ps1 +++ b/integration/hurl/tests_ok/json_output.ps1 @@ -1,3 +1,4 @@ Set-StrictMode -Version latest $ErrorActionPreference = 'Stop' + hurl --json tests_ok/json_output.hurl diff --git a/integration/hurl/tests_ok/json_output.sh b/integration/hurl/tests_ok/json_output.sh index de07db178c6..81700de735d 100755 --- a/integration/hurl/tests_ok/json_output.sh +++ b/integration/hurl/tests_ok/json_output.sh @@ -1,3 +1,4 @@ #!/bin/bash set -Eeuo pipefail + hurl --json tests_ok/json_output.hurl diff --git a/integration/hurl/tests_ok/parallel_json.out.pattern b/integration/hurl/tests_ok/parallel_json.out.pattern index 47eee66c035..53ef52ad9d5 100644 --- a/integration/hurl/tests_ok/parallel_json.out.pattern +++ b/integration/hurl/tests_ok/parallel_json.out.pattern @@ -1,7 +1,7 @@ -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=<<<.*?>>>'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=<<<.*?>>>'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=<<<.*?>>>'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=<<<.*?>>>'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=<<<.*?>>>'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=<<<.*?>>>'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"<<<.*?>>>"}],"url":"http://localhost:8000/parallel/hello?name=<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=<<<.*?>>>'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_<<<.*?>>>.hurl","success":true,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_ok/parallel_one_worker_test.out.pattern b/integration/hurl/tests_ok/parallel_one_worker_test.out.pattern index 7a4d0b4b33f..7ec6f0453b0 100644 --- a/integration/hurl/tests_ok/parallel_one_worker_test.out.pattern +++ b/integration/hurl/tests_ok/parallel_one_worker_test.out.pattern @@ -1,7 +1,7 @@ -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"A"}],"url":"http://localhost:8000/parallel/hello?name=A"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_a.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"B"}],"url":"http://localhost:8000/parallel/hello?name=B"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_b.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"C"}],"url":"http://localhost:8000/parallel/hello?name=C"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_c.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"D"}],"url":"http://localhost:8000/parallel/hello?name=D"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_d.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"E"}],"url":"http://localhost:8000/parallel/hello?name=E"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_e.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"F"}],"url":"http://localhost:8000/parallel/hello?name=F"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_f.hurl","success":true,"time":<<<\d+>>>} -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"G"}],"url":"http://localhost:8000/parallel/hello?name=G"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_g.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"A"}],"url":"http://localhost:8000/parallel/hello?name=A"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=A'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_a.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"B"}],"url":"http://localhost:8000/parallel/hello?name=B"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=B'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_b.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"C"}],"url":"http://localhost:8000/parallel/hello?name=C"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=C'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_c.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"D"}],"url":"http://localhost:8000/parallel/hello?name=D"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=D'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_d.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"E"}],"url":"http://localhost:8000/parallel/hello?name=E"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=E'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_e.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"F"}],"url":"http://localhost:8000/parallel/hello?name=F"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=F'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_f.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[{"name":"name","value":"G"}],"url":"http://localhost:8000/parallel/hello?name=G"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"31"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/parallel/hello?name=G'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/parallel_g.hurl","success":true,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_ok/proxy.ps1 b/integration/hurl/tests_ok/proxy.ps1 index 6847228bed8..9702eb59062 100644 --- a/integration/hurl/tests_ok/proxy.ps1 +++ b/integration/hurl/tests_ok/proxy.ps1 @@ -1,4 +1,5 @@ Set-StrictMode -Version latest $ErrorActionPreference = 'Stop' + hurl --proxy localhost:3128 --verbose tests_ok/proxy.hurl hurl --proxy 127.0.0.1:3128 --verbose tests_ok/proxy.hurl diff --git a/integration/hurl/tests_ok/proxy.sh b/integration/hurl/tests_ok/proxy.sh index 73441ccfe8d..ae595080673 100755 --- a/integration/hurl/tests_ok/proxy.sh +++ b/integration/hurl/tests_ok/proxy.sh @@ -1,5 +1,6 @@ #!/bin/bash set -Eeuo pipefail + hurl --proxy localhost:3128 --verbose tests_ok/proxy.hurl hurl --proxy 127.0.0.1:3128 --verbose tests_ok/proxy.hurl diff --git a/integration/hurl/tests_ok/proxy_option.ps1 b/integration/hurl/tests_ok/proxy_option.ps1 index 3e5eed842ce..814e7992b1d 100644 --- a/integration/hurl/tests_ok/proxy_option.ps1 +++ b/integration/hurl/tests_ok/proxy_option.ps1 @@ -1,3 +1,4 @@ Set-StrictMode -Version latest $ErrorActionPreference = 'Stop' -hurl tests_ok/proxy_option.hurl --verbose + +hurl --verbose tests_ok/proxy_option.hurl diff --git a/integration/hurl/tests_ok/proxy_option.sh b/integration/hurl/tests_ok/proxy_option.sh index d0cb3981bac..e8c1b7678dd 100755 --- a/integration/hurl/tests_ok/proxy_option.sh +++ b/integration/hurl/tests_ok/proxy_option.sh @@ -1,3 +1,4 @@ #!/bin/bash set -Eeuo pipefail -hurl tests_ok/proxy_option.hurl --verbose + +hurl --verbose tests_ok/proxy_option.hurl diff --git a/integration/hurl/tests_ok/report_json.out.pattern b/integration/hurl/tests_ok/report_json.out.pattern index ecf1e2773fe..299740fbd62 100644 --- a/integration/hurl/tests_ok/report_json.out.pattern +++ b/integration/hurl/tests_ok/report_json.out.pattern @@ -1 +1 @@ -[{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<[\w.-]+>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/hello"},"response":{"body":"store<<<[/\\\w-]+>>>_response.html","cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<[\d.]+>>> Python/<<<[\d.]+>>>"},{"name":"Date","value":"<<<[\w, :]+>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<[\dTZ:.-]+>>>","connect":<<<\d+>>>,"end_call":"<<<[\dTZ:.-]+>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/test.1.hurl","success":true,"time":<<<\d+>>>},{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<[\w.-]+>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/hello"},"response":{"body":"store<<<[/\\\w-]+>>>_response.html","cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<[\d.]+>>> Python/<<<[\d.]+>>>"},{"name":"Date","value":"<<<[\w, :]+>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<[\dTZ:.-]+>>>","connect":<<<\d+>>>,"end_call":"<<<[\dTZ:.-]+>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>},{"asserts":[{"line":7,"success":true},{"line":7,"success":true},{"line":8,"message":"Assert body value\n --> tests_ok/test.2.hurl:8:1\n |\n | GET http://localhost:8000/hello\n | ...\n 8 | `Goodbye World!`\n | ^^^^^^^^^^^^^^^^ actual value is \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<[\w.-]+>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/hello"},"response":{"body":"store<<<[/\\\w-]+>>>_response.html","cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<[\d.]+>>> Python/<<<[\d.]+>>>"},{"name":"Date","value":"<<<[\w, :]+>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<[\dTZ:.-]+>>>","connect":<<<\d+>>>,"end_call":"<<<[\dTZ:.-]+>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":6,"time":<<<\d+>>>}],"filename":"tests_ok/test.2.hurl","success":false,"time":<<<\d+>>>},{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<[\w.-]+>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/hello"},"response":{"body":"store<<<[/\\\w-]+>>>_response.html","cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<[\d.]+>>> Python/<<<[\d.]+>>>"},{"name":"Date","value":"<<<[\w, :]+>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<[\dTZ:.-]+>>>","connect":<<<\d+>>>,"end_call":"<<<[\dTZ:.-]+>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/test.3.hurl","success":true,"time":<<<\d+>>>}] +[{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/hello"},"response":{"body":"store<<<[/\\\w-]+>>>_response.html","cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/hello'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/test.1.hurl","success":true,"time":<<<\d+>>>},{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/hello"},"response":{"body":"store<<<[/\\\w-]+>>>_response.html","cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/hello'","index":1,"line":1,"time":<<<\d+>>>},{"asserts":[{"line":7,"success":true},{"line":7,"success":true},{"line":8,"message":"Assert body value\n --> tests_ok/test.2.hurl:8:1\n |\n | GET http://localhost:8000/hello\n | ...\n 8 | `Goodbye World!`\n | ^^^^^^^^^^^^^^^^ actual value is \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/hello"},"response":{"body":"store<<<[/\\\w-]+>>>_response.html","cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/hello'","index":2,"line":6,"time":<<<\d+>>>}],"filename":"tests_ok/test.2.hurl","success":false,"time":<<<\d+>>>},{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/hello"},"response":{"body":"store<<<[/\\\w-]+>>>_response.html","cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/hello'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_ok/test.3.hurl","success":true,"time":<<<\d+>>>}] diff --git a/integration/hurl/tests_ok/retry.out.pattern b/integration/hurl/tests_ok/retry.out.pattern index 767ce6db09c..eb6fd4a10ed 100644 --- a/integration/hurl/tests_ok/retry.out.pattern +++ b/integration/hurl/tests_ok/retry.out.pattern @@ -1 +1 @@ -{"cookies":[],"entries":[{"asserts":[{"line":3,"success":true},{"line":3,"success":true},{"line":7,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"POST","query_string":[],"url":"http://localhost:8000/jobs"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":201},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"job_id","value":"<<<.*?>>>"}],"index":1,"line":2,"time":<<<\d+>>>},{"asserts":[{"line":12,"success":true},{"line":12,"success":true},{"line":14,"message":"Assert failure\n --> tests_ok/retry.hurl:14:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n14 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":12,"success":true},{"line":12,"success":true},{"line":14,"message":"Assert failure\n --> tests_ok/retry.hurl:14:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n14 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":12,"success":true},{"line":12,"success":true},{"line":14,"message":"Assert failure\n --> tests_ok/retry.hurl:14:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n14 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":12,"success":true},{"line":12,"success":true},{"line":14,"message":"Assert failure\n --> tests_ok/retry.hurl:14:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n14 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":12,"success":true},{"line":12,"success":true},{"line":14,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"62"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":19,"success":true},{"line":19,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"DELETE","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":3,"line":18,"time":<<<\d+>>>},{"asserts":[{"line":23,"success":true},{"line":23,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"42"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":404},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":4,"line":22,"time":<<<\d+>>>}],"filename":"tests_ok/retry.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":3,"success":true},{"line":3,"success":true},{"line":7,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"POST","query_string":[],"url":"http://localhost:8000/jobs"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":201},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"job_id","value":"<<<.*?>>>"}],"curl_cmd":"curl --request POST 'http://localhost:8000/jobs'","index":1,"line":2,"time":<<<\d+>>>},{"asserts":[{"line":12,"success":true},{"line":12,"success":true},{"line":14,"message":"Assert failure\n --> tests_ok/retry.hurl:14:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n14 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":12,"success":true},{"line":12,"success":true},{"line":14,"message":"Assert failure\n --> tests_ok/retry.hurl:14:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n14 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":12,"success":true},{"line":12,"success":true},{"line":14,"message":"Assert failure\n --> tests_ok/retry.hurl:14:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n14 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":12,"success":true},{"line":12,"success":true},{"line":14,"message":"Assert failure\n --> tests_ok/retry.hurl:14:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n14 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":12,"success":true},{"line":12,"success":true},{"line":14,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"62"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":19,"success":true},{"line":19,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"DELETE","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl --request DELETE 'http://localhost:8000/jobs/<<<.*?>>>'","index":3,"line":18,"time":<<<\d+>>>},{"asserts":[{"line":23,"success":true},{"line":23,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"42"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":404},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":4,"line":22,"time":<<<\d+>>>}],"filename":"tests_ok/retry.hurl","success":true,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_ok/retry.ps1 b/integration/hurl/tests_ok/retry.ps1 index 3fcc1efaf4f..956c07b93f3 100644 --- a/integration/hurl/tests_ok/retry.ps1 +++ b/integration/hurl/tests_ok/retry.ps1 @@ -1,3 +1,4 @@ Set-StrictMode -Version latest $ErrorActionPreference = 'Stop' + hurl --retry 10 --retry-interval 100 --verbose --json tests_ok/retry.hurl diff --git a/integration/hurl/tests_ok/retry.sh b/integration/hurl/tests_ok/retry.sh index 6282af7eeb3..81149137e76 100755 --- a/integration/hurl/tests_ok/retry.sh +++ b/integration/hurl/tests_ok/retry.sh @@ -1,3 +1,4 @@ #!/bin/bash set -Eeuo pipefail + hurl --retry 10 --retry-interval 100 --verbose --json tests_ok/retry.hurl diff --git a/integration/hurl/tests_ok/retry_option.out.pattern b/integration/hurl/tests_ok/retry_option.out.pattern index e1cd08c6f9c..99d183c671e 100644 --- a/integration/hurl/tests_ok/retry_option.out.pattern +++ b/integration/hurl/tests_ok/retry_option.out.pattern @@ -1 +1 @@ -{"cookies":[],"entries":[{"asserts":[{"line":3,"success":true},{"line":3,"success":true},{"line":7,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"POST","query_string":[],"url":"http://localhost:8000/jobs"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":201},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"job_id","value":"<<<.*?>>>"}],"index":1,"line":2,"time":<<<\d+>>>},{"asserts":[{"line":15,"success":true},{"line":15,"success":true},{"line":17,"message":"Assert failure\n --> tests_ok/retry_option.hurl:17:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n17 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":15,"success":true},{"line":15,"success":true},{"line":17,"message":"Assert failure\n --> tests_ok/retry_option.hurl:17:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n17 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":15,"success":true},{"line":15,"success":true},{"line":17,"message":"Assert failure\n --> tests_ok/retry_option.hurl:17:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n17 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":15,"success":true},{"line":15,"success":true},{"line":17,"message":"Assert failure\n --> tests_ok/retry_option.hurl:17:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n17 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":15,"success":true},{"line":15,"success":true},{"line":17,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"62"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":22,"success":true},{"line":22,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"DELETE","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":3,"line":21,"time":<<<\d+>>>},{"asserts":[{"line":26,"success":true},{"line":26,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"42"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":404},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":4,"line":25,"time":<<<\d+>>>}],"filename":"tests_ok/retry_option.hurl","success":true,"time":<<<\d+>>>} +{"cookies":[],"entries":[{"asserts":[{"line":3,"success":true},{"line":3,"success":true},{"line":7,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"POST","query_string":[],"url":"http://localhost:8000/jobs"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":201},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[{"name":"job_id","value":"<<<.*?>>>"}],"curl_cmd":"curl --request POST 'http://localhost:8000/jobs'","index":1,"line":2,"time":<<<\d+>>>},{"asserts":[{"line":15,"success":true},{"line":15,"success":true},{"line":17,"message":"Assert failure\n --> tests_ok/retry_option.hurl:17:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n17 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":15,"success":true},{"line":15,"success":true},{"line":17,"message":"Assert failure\n --> tests_ok/retry_option.hurl:17:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n17 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":15,"success":true},{"line":15,"success":true},{"line":17,"message":"Assert failure\n --> tests_ok/retry_option.hurl:17:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n17 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":15,"success":true},{"line":15,"success":true},{"line":17,"message":"Assert failure\n --> tests_ok/retry_option.hurl:17:0\n |\n | GET http://localhost:8000/jobs/{{job_id}}\n | ...\n17 | jsonpath \"$.state\" == \"COMPLETED\"\n | actual: string \n | expected: string \n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":15,"success":true},{"line":15,"success":true},{"line":17,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"62"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":2,"line":11,"time":<<<\d+>>>},{"asserts":[{"line":22,"success":true},{"line":22,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"DELETE","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl --request DELETE 'http://localhost:8000/jobs/<<<.*?>>>'","index":3,"line":21,"time":<<<\d+>>>},{"asserts":[{"line":26,"success":true},{"line":26,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/jobs/<<<.*?>>>"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"42"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":404},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/jobs/<<<.*?>>>'","index":4,"line":25,"time":<<<\d+>>>}],"filename":"tests_ok/retry_option.hurl","success":true,"time":<<<\d+>>>} diff --git a/integration/hurl/tests_ok/retry_option.ps1 b/integration/hurl/tests_ok/retry_option.ps1 index f540b015ee9..bce3bf3d8a5 100644 --- a/integration/hurl/tests_ok/retry_option.ps1 +++ b/integration/hurl/tests_ok/retry_option.ps1 @@ -1,3 +1,4 @@ Set-StrictMode -Version latest $ErrorActionPreference = 'Stop' + hurl --verbose --json tests_ok/retry_option.hurl diff --git a/integration/hurl/tests_ok/retry_option.sh b/integration/hurl/tests_ok/retry_option.sh index 02e436b5817..0595c8fb78b 100755 --- a/integration/hurl/tests_ok/retry_option.sh +++ b/integration/hurl/tests_ok/retry_option.sh @@ -1,3 +1,4 @@ #!/bin/bash set -Eeuo pipefail + hurl --verbose --json tests_ok/retry_option.hurl diff --git a/packages/hurl/src/cli/summary.rs b/packages/hurl/src/cli/summary.rs index c881d4be4e2..3833e9e7541 100644 --- a/packages/hurl/src/cli/summary.rs +++ b/packages/hurl/src/cli/summary.rs @@ -60,6 +60,7 @@ fn requests_count(runs: &[HurlRun]) -> usize { #[cfg(test)] pub mod tests { + use hurl::http::CurlCmd; use hurl::runner::{EntryResult, HurlResult}; use hurl_core::ast::SourceInfo; use hurl_core::input::Input; @@ -79,6 +80,7 @@ pub mod tests { errors: vec![], transfer_duration: Duration::from_millis(0), compressed: false, + curl_cmd: CurlCmd::default(), }; HurlRun { content: String::new(), diff --git a/packages/hurl/src/http/client.rs b/packages/hurl/src/http/client.rs index 07f0b2aeb0e..6e0fd20fa6c 100644 --- a/packages/hurl/src/http/client.rs +++ b/packages/hurl/src/http/client.rs @@ -762,10 +762,9 @@ impl Client { context_dir: &ContextDir, output: Option<&Output>, options: &ClientOptions, - ) -> String { + ) -> CurlCmd { let cookies = self.cookie_storage(); - let cmd = CurlCmd::new(request_spec, &cookies, context_dir, output, options); - cmd.to_string() + CurlCmd::new(request_spec, &cookies, context_dir, output, options) } /// Returns the SSL certificates information associated to this call. @@ -1163,7 +1162,7 @@ mod tests { let cmd = client.curl_command_line(&request, &context_dir, output, &options); assert_eq!( - cmd, + cmd.to_string(), "curl \ --aws-sigv4 aws:amz:sts \ --cacert /etc/cert.pem \ diff --git a/packages/hurl/src/http/curl_cmd.rs b/packages/hurl/src/http/curl_cmd.rs index fccd84ff60f..a46c63d049f 100644 --- a/packages/hurl/src/http/curl_cmd.rs +++ b/packages/hurl/src/http/curl_cmd.rs @@ -28,6 +28,7 @@ use std::collections::HashMap; use std::path::Path; /// Represents a curl command, with arguments. +#[derive(Clone, Debug, PartialEq, Eq)] pub struct CurlCmd { /// The args of this command. args: Vec, @@ -39,6 +40,14 @@ impl fmt::Display for CurlCmd { } } +impl Default for CurlCmd { + fn default() -> Self { + CurlCmd { + args: vec!["curl".to_string()], + } + } +} + impl CurlCmd { /// Creates a new curl command, based on an HTTP request, cookies, a context directory, output /// and runner options. diff --git a/packages/hurl/src/http/mod.rs b/packages/hurl/src/http/mod.rs index c1730b40174..1e6356e6cc1 100644 --- a/packages/hurl/src/http/mod.rs +++ b/packages/hurl/src/http/mod.rs @@ -25,6 +25,7 @@ pub(crate) use self::client::Client; pub use self::cookie::{CookieAttribute, ResponseCookie}; pub use self::core::Cookie; pub(crate) use self::core::{Param, RequestCookie}; +pub use self::curl_cmd::CurlCmd; pub(crate) use self::error::HttpError; pub use self::header::{ Header, HeaderVec, ACCEPT_ENCODING, AUTHORIZATION, CONTENT_TYPE, COOKIE, EXPECT, USER_AGENT, diff --git a/packages/hurl/src/json/result.rs b/packages/hurl/src/json/result.rs index 382cd21556d..a0e6f27a614 100644 --- a/packages/hurl/src/json/result.rs +++ b/packages/hurl/src/json/result.rs @@ -77,6 +77,7 @@ struct EntryResultJson { captures: Vec, asserts: Vec, time: u64, + curl_cmd: String, } #[derive(Deserialize, Serialize)] @@ -248,6 +249,7 @@ impl EntryResultJson { captures, asserts, time: entry.transfer_duration.as_millis() as u64, + curl_cmd: entry.curl_cmd.to_string(), }) } } diff --git a/packages/hurl/src/output/raw.rs b/packages/hurl/src/output/raw.rs index 05592795292..4bb13d5c069 100644 --- a/packages/hurl/src/output/raw.rs +++ b/packages/hurl/src/output/raw.rs @@ -123,7 +123,7 @@ mod tests { use hurl_core::ast::SourceInfo; use hurl_core::reader::Pos; - use crate::http::{Call, Header, HeaderVec, HttpVersion, Request, Response, Url}; + use crate::http::{Call, CurlCmd, Header, HeaderVec, HttpVersion, Request, Response, Url}; use crate::output::write_last_body; use crate::runner::{EntryResult, HurlResult, Output}; use crate::util::term::{Stdout, WriteMode}; @@ -168,6 +168,7 @@ mod tests { errors: vec![], transfer_duration: Duration::from_millis(0), compressed: false, + curl_cmd: CurlCmd::default(), }, EntryResult { entry_index: 2, @@ -187,6 +188,7 @@ mod tests { errors: vec![], transfer_duration: Duration::from_millis(0), compressed: false, + curl_cmd: CurlCmd::default(), }, EntryResult { entry_index: 3, @@ -214,6 +216,7 @@ mod tests { errors: vec![], transfer_duration: Duration::from_millis(0), compressed: false, + curl_cmd: CurlCmd::default(), }, ], duration: Duration::from_millis(100), diff --git a/packages/hurl/src/report/junit/mod.rs b/packages/hurl/src/report/junit/mod.rs index 806d9bf4a1d..cb1cf7d976b 100644 --- a/packages/hurl/src/report/junit/mod.rs +++ b/packages/hurl/src/report/junit/mod.rs @@ -152,7 +152,7 @@ mod tests { use hurl_core::input::Input; use hurl_core::reader::Pos; - use crate::http::HttpError; + use crate::http::{CurlCmd, HttpError}; use crate::report::junit::xml::XmlDocument; use crate::report::junit::{create_testsuite, Testcase}; use crate::runner::{EntryResult, HurlResult, RunnerError, RunnerErrorKind}; @@ -189,6 +189,7 @@ mod tests { )], transfer_duration: Duration::from_millis(0), compressed: false, + curl_cmd: CurlCmd::default(), }], duration: Duration::from_millis(230), success: true, @@ -215,6 +216,7 @@ mod tests { )], transfer_duration: Duration::from_millis(0), compressed: false, + curl_cmd: CurlCmd::default(), }], duration: Duration::from_millis(230), success: true, diff --git a/packages/hurl/src/report/junit/testcase.rs b/packages/hurl/src/report/junit/testcase.rs index c4eca4d3b7a..b346ccb3f2d 100644 --- a/packages/hurl/src/report/junit/testcase.rs +++ b/packages/hurl/src/report/junit/testcase.rs @@ -97,7 +97,7 @@ mod test { use hurl_core::input::Input; use hurl_core::reader::Pos; - use crate::http::HttpError; + use crate::http::{CurlCmd, HttpError}; use crate::report::junit::testcase::Testcase; use crate::report::junit::xml::XmlDocument; use crate::runner::{EntryResult, HurlResult, RunnerError, RunnerErrorKind}; @@ -144,6 +144,7 @@ HTTP/1.0 200 )], transfer_duration: Duration::from_millis(0), compressed: false, + curl_cmd: CurlCmd::default(), }], duration: Duration::from_millis(230), success: true, @@ -186,6 +187,7 @@ HTTP/1.0 200 )], transfer_duration: Duration::from_millis(0), compressed: false, + curl_cmd: CurlCmd::default(), }], duration: Duration::from_millis(230), success: true, diff --git a/packages/hurl/src/runner/entry.rs b/packages/hurl/src/runner/entry.rs index 2ba99555cd8..5967b1b7981 100644 --- a/packages/hurl/src/runner/entry.rs +++ b/packages/hurl/src/runner/entry.rs @@ -20,7 +20,7 @@ use std::collections::HashMap; use hurl_core::ast::*; use crate::http; -use crate::http::ClientOptions; +use crate::http::{ClientOptions, CurlCmd}; use crate::runner::cache::BodyCache; use crate::runner::error::RunnerError; use crate::runner::result::{AssertResult, EntryResult}; @@ -75,14 +75,15 @@ pub fn run( http_client.clear_cookie_storage(&client_options); } - log_request( - http_client, + let curl_cmd = http_client.curl_command_line( &http_request, - runner_options, + context_dir, + runner_options.output.as_ref(), &client_options, - logger, ); + log_request(http_client, &curl_cmd, &http_request, logger); + // Run the HTTP requests (optionally follow redirection) let calls = match http_client.execute_with_redirect(&http_request, &client_options, logger) { Ok(calls) => calls, @@ -97,6 +98,7 @@ pub fn run( source_info, errors: vec![error], compressed, + curl_cmd, ..Default::default() }; } @@ -133,6 +135,7 @@ pub fn run( errors, transfer_duration, compressed, + curl_cmd, }; } } @@ -153,6 +156,7 @@ pub fn run( errors: vec![e], transfer_duration, compressed, + curl_cmd, }; } } @@ -186,6 +190,7 @@ pub fn run( errors, transfer_duration, compressed, + curl_cmd, } } @@ -248,9 +253,8 @@ impl ClientOptions { /// Logs this HTTP `request`. fn log_request( http_client: &mut http::Client, + curl_cmd: &CurlCmd, request: &http::RequestSpec, - runner_options: &RunnerOptions, - client_options: &ClientOptions, logger: &mut Logger, ) { logger.debug(""); @@ -291,11 +295,7 @@ fn log_request( } logger.debug(""); logger.debug("Request can be run with the following curl command:"); - let context_dir = &runner_options.context_dir; - let output = &runner_options.output; - let curl_command = - http_client.curl_command_line(request, context_dir, output.as_ref(), client_options); - logger.debug(&curl_command); + logger.debug(&curl_cmd.to_string()); logger.debug(""); } diff --git a/packages/hurl/src/runner/result.rs b/packages/hurl/src/runner/result.rs index 4ee91cd727c..5ba4fef8dee 100644 --- a/packages/hurl/src/runner/result.rs +++ b/packages/hurl/src/runner/result.rs @@ -20,7 +20,7 @@ use std::time::Duration; use hurl_core::ast::SourceInfo; use hurl_core::reader::Pos; -use crate::http::{Call, Cookie}; +use crate::http::{Call, Cookie, CurlCmd}; use crate::runner::error::RunnerError; use crate::runner::output::Output; use crate::runner::value::Value; @@ -93,6 +93,8 @@ pub struct EntryResult { /// server is requested to send compressed response, and the response should be uncompressed /// when outputted on stdout. pub compressed: bool, + /// The debug curl command line from this entry result. + pub curl_cmd: CurlCmd, } impl Default for EntryResult { @@ -106,6 +108,7 @@ impl Default for EntryResult { errors: vec![], transfer_duration: Duration::from_millis(0), compressed: false, + curl_cmd: CurlCmd::default(), } } }