diff --git a/integration/tests_failed/assert_match_utf8.out.pattern b/integration/tests_failed/assert_match_utf8.out.pattern index 05ec238b5..b5b617006 100644 --- a/integration/tests_failed/assert_match_utf8.out.pattern +++ b/integration/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 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","queryString":[],"url":"http://localhost:8000/error-assert/match-utf8"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"1"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"time":~~~}],"filename":"tests~_failed/assert_match_utf8.hurl","success":false,"time":~~~} +{"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 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","queryString":[],"url":"http://localhost:8000/error-assert/match-utf8"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"1"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":1,"time":~~~}],"filename":"tests_failed/assert_match_utf8.hurl","success":false,"time":~~~} diff --git a/integration/tests_failed/assert_status.out.pattern b/integration/tests_failed/assert_status.out.pattern index 4417deea9..f117758ad 100644 --- a/integration/tests_failed/assert_status.out.pattern +++ b/integration/tests_failed/assert_status.out.pattern @@ -1 +1 @@ -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"message":"Assert status code\n --> tests_failed/assert_status.hurl:2:10\n |\n 2 | HTTP/1.0 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","queryString":[],"url":"http://localhost:8000/not_found"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"232"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":404}}],"captures":[],"time":~~~}],"filename":"tests_failed/assert_status.hurl","success":false,"time":~~~} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"message":"Assert status code\n --> tests_failed/assert_status.hurl:2:10\n |\n 2 | HTTP/1.0 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","queryString":[],"url":"http://localhost:8000/not_found"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"232"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":404}}],"captures":[],"index":1,"time":~~~}],"filename":"tests_failed/assert_status.hurl","success":false,"time":~~~} diff --git a/integration/tests_failed/assert_template_variable_not_found.out.pattern b/integration/tests_failed/assert_template_variable_not_found.out.pattern index 79acd793e..7b9a04d9e 100644 --- a/integration/tests_failed/assert_template_variable_not_found.out.pattern +++ b/integration/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:33\n |\n 4 | header \"content-type\" equals \"{{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","queryString":[],"url":"http://localhost:8000/error-assert-template-variable-not-found"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"time":~~~}],"filename":"tests_failed/assert_template_variable_not_found.hurl","success":false,"time":~~~} +{"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:33\n |\n 4 | header \"content-type\" equals \"{{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","queryString":[],"url":"http://localhost:8000/error-assert-template-variable-not-found"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":1,"time":~~~}],"filename":"tests_failed/assert_template_variable_not_found.hurl","success":false,"time":~~~} diff --git a/integration/tests_failed/assert_value_error.out.pattern b/integration/tests_failed/assert_value_error.out.pattern index 8983d0347..627dd7a21 100644 --- a/integration/tests_failed/assert_value_error.out.pattern +++ b/integration/tests_failed/assert_value_error.out.pattern @@ -1 +1 @@ -{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:4:0\n |\n 4 | header \"content-type\" equals \"XXX\"\n | actual: string \n | expected: string \n |","success":false},{"line":5,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:5:0\n |\n 5 | header \"content-type\" notEquals \"text/html; charset=utf-8\"\n | actual: string \n | expected: string \n |","success":false},{"line":6,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:6:0\n |\n 6 | jsonpath \"$.id\" equals \"000001\"\n | actual: none\n | expected: string <000001>\n |","success":false},{"line":7,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:7:0\n |\n 7 | jsonpath \"$.values\" includes 100\n | actual: [int <1>, int <2>, int <3>]\n | expected: includes int <100>\n |","success":fals~e},{"line":8,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:8:0\n |\n 8 | jsonpath \"$.values\" not contains \"Hello\"\n | actual: [int <1>, int <2>, int <3>]\n | expected: not contains string \n | >>> types between actual and expected are not consistent\n |","success":false},{"line":9,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:9:0\n |\n 9 | jsonpath \"$.count\" greaterThan 5\n | actual: int <2>\n | expected: greater than int <5>\n |","success":false},{"line":10,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:10:0\n |\n10 | jsonpath \"$.count\" isFloat\n | actual: int <2>\n | expected: float\n |","success":false},{"line":11,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:11:0\n |\n11 | bytes contains hex,00;\n | actual: byte array <7b202276616c756573223a205b312c322c335d2c2022636f756e74223a20327d>\n | expected: contains byte array <00>\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/error-assert-value"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"32"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"time":~~~}],"filename":"tests_failed/assert_value_error.hurl","success":false,"time":~~~} +{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:4:0\n |\n 4 | header \"content-type\" equals \"XXX\"\n | actual: string \n | expected: string \n |","success":false},{"line":5,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:5:0\n |\n 5 | header \"content-type\" notEquals \"text/html; charset=utf-8\"\n | actual: string \n | expected: string \n |","success":false},{"line":6,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:6:0\n |\n 6 | jsonpath \"$.id\" equals \"000001\"\n | actual: none\n | expected: string <000001>\n |","success":false},{"line":7,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:7:0\n |\n 7 | jsonpath \"$.values\" includes 100\n | actual: [int <1>, int <2>, int <3>]\n | expected: includes int <100>\n |","success":false},{"line":8,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:8:0\n |\n 8 | jsonpath \"$.values\" not contains \"Hello\"\n | actual: [int <1>, int <2>, int <3>]\n | expected: not contains string \n | >>> types between actual and expected are not consistent\n |","success":false},{"line":9,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:9:0\n |\n 9 | jsonpath \"$.count\" greaterThan 5\n | actual: int <2>\n | expected: greater than int <5>\n |","success":false},{"line":10,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:10:0\n |\n10 | jsonpath \"$.count\" isFloat\n | actual: int <2>\n | expected: float\n |","success":false},{"line":11,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:11:0\n |\n11 | bytes contains hex,00;\n | actual: byte array <7b202276616c756573223a205b312c322c335d2c2022636f756e74223a20327d>\n | expected: contains byte array <00>\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/error-assert-value"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"32"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":1,"time":~~~}],"filename":"tests_failed/assert_value_error.hurl","success":false,"time":~~~} diff --git a/integration/tests_failed/query_header_not_found.out.pattern b/integration/tests_failed/query_header_not_found.out.pattern index 1e48ad93e..7bd52b68e 100644 --- a/integration/tests_failed/query_header_not_found.out.pattern +++ b/integration/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 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","queryString":[],"url":"http://localhost:8000/error-query-header-not-found"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"time":~~~}],"filename":"tests_failed/query_header_not_found.hurl","success":false,"time":~~~} +{"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 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","queryString":[],"url":"http://localhost:8000/error-query-header-not-found"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":1,"time":~~~}],"filename":"tests_failed/query_header_not_found.hurl","success":false,"time":~~~} diff --git a/integration/tests_ok/assert_header.out.pattern b/integration/tests_ok/assert_header.out.pattern index 07106c3eb..1434d0744 100644 --- a/integration/tests_ok/assert_header.out.pattern +++ b/integration/tests_ok/assert_header.out.pattern @@ -1 +1 @@ -{"cookies":[{"domain":"localhost","expires":"0","https":"FALSE","include_subdomain":"FALSE","name":"cookie1","path":"/","value":"value1"},{"domain":"localhost","expires":"0","https":"FALSE","include_subdomain":"FALSE","name":"cookie2","path":"/","value":"value2"},{"domain":"localhost","expires":"0","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}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[],"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":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Header1","value":"value1"},{"name":"ETag","value":"\"33a64df551425fcc55e4d42a148795d9f25f89d4\""},{"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":"Content-Length","value":"0"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"time":~~~}],"filename":"tests_ok/assert_header.hurl","success":true,"time":~~~} +{"cookies":[{"domain":"localhost","expires":"0","https":"FALSE","include_subdomain":"FALSE","name":"cookie1","path":"/","value":"value1"},{"domain":"localhost","expires":"0","https":"FALSE","include_subdomain":"FALSE","name":"cookie2","path":"/","value":"value2"},{"domain":"localhost","expires":"0","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}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[],"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":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Header1","value":"value1"},{"name":"ETag","value":"\"33a64df551425fcc55e4d42a148795d9f25f89d4\""},{"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":"Content-Length","value":"0"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":1,"time":~~~}],"filename":"tests_ok/assert_header.hurl","success":true,"time":~~~} diff --git a/integration/tests_ok/color.err b/integration/tests_ok/color.err index fdad8247b..ef3c44864 100644 --- a/integration/tests_ok/color.err +++ b/integration/tests_ok/color.err @@ -1,6 +1,7 @@ * Options: * fail fast: true -* insecure: false * follow redirect: false +* insecure: false * max redirect: 50 -warning: No entry have been executed for file tests_ok/color.hurl +* retry: false +warning: No entry have been executed for file tests_ok/color.hurl diff --git a/integration/tests_ok/json_output.out.pattern b/integration/tests_ok/json_output.out.pattern index 308dcaf14..0a7918729 100644 --- a/integration/tests_ok/json_output.out.pattern +++ b/integration/tests_ok/json_output.out.pattern @@ -1 +1 @@ -{"cookies":[{"domain":"localhost","expires":"0","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","queryString":[],"url":"http://localhost:8000/hello"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"time":~~~},{"asserts":[{"line":14,"success":true},{"line":14,"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","queryString":[],"url":"http://localhost:8000/cookies/set-session-cookie2-valueA"},"response":{"cookies":[{"name":"cookie2","path":"/","value":"valueA"}],"headers":[{"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":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"time":~~~},{"asserts":[{"line":22,"success":true},{"line":22,"success":true},{"line":24,"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","queryString":[],"url":"http://localhost:8000/follow-redirect"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"286"},{"name":"Location","value":"http://localhost:8000/following-redirect"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":302}}],"captures":[],"time":~~~},{"asserts":[{"line":32,"success":true},{"line":32,"success":true},{"line":35,"success":true},{"line":34,"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","queryString":[],"url":"http://localhost:8000/follow-redirect"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"286"},{"name":"Location","value":"http://localhost:8000/following-redirect"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":302}},{"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","queryString":[],"url":"http://localhost:8000/following-redirect"},"response":{"cookies":[],"headers":[{"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":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":302}},{"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","queryString":[],"url":"http://localhost:8000/followed-redirect"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"18"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"time":~~~},{"asserts":[{"line":41,"success":true},{"line":41,"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","queryString":[],"url":"http://localhost:8000/captures"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Header1","value":"value1"},{"name":"Header2","value":"Hello Bob!"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[{"name":"param1","value":"value1"},{"name":"param2","value":"Bob"},{"name":"param3","value":"Bob"}],"time":~~~},{"asserts":[{"line":51,"success":true},{"line":51,"success":true},{"line":53,"success":true},{"line":54,"success":true},{"line":55,"success":true},{"line":56,"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","queryString":[],"url":"http://localhost:8000/assert-json"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"160"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"time":~~~}],"filename":"tests_ok/json_output.hurl","success":true,"time":~~~} +{"cookies":[{"domain":"localhost","expires":"0","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":"~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/hello"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":1,"time":~~~},{"asserts":[{"line":14,"success":true},{"line":14,"success":true},{"line":16,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/cookies/set-session-cookie2-valueA"},"response":{"cookies":[{"name":"cookie2","path":"/","value":"valueA"}],"headers":[{"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":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":2,"time":~~~},{"asserts":[{"line":22,"success":true},{"line":22,"success":true},{"line":24,"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":"~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/follow-redirect"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"286"},{"name":"Location","value":"http://localhost:8000/following-redirect"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":302}}],"captures":[],"index":3,"time":~~~},{"asserts":[{"line":32,"success":true},{"line":32,"success":true},{"line":35,"success":true},{"line":34,"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":"~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/follow-redirect"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"286"},{"name":"Location","value":"http://localhost:8000/follo~wing-redirect"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":302}},{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"User-Agent","value":"~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/following-redirect"},"response":{"cookies":[],"headers":[{"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":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":302}},{"request":{"cookies":[{"name":"cookie2","value":"valueA"}],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"Cookie","value":"cookie2=valueA"},{"name":"User-Agent","value":"~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/followed-redirect"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"18"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":4,"time":~~~},{"asserts":[{"line":41,"success":true},{"line":41,"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":"~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/captures"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Header1","value":"value1"},{"name":"Header2","value":"Hello Bob!"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[{"name":"param1","value":"value1"},{"name":"param2","value":"Bob"},{"name":"param3","value":"Bob"}],"index":5,"time":~~~},{"asserts":[{"line":51,"success":true},{"line":51,"success":true},{"line":53,"success":true},{"line":54,"success":true},{"line":55,"success":true},{"line":56,"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":"~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/assert-json"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"160"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":6,"time":~~~}],"filename":"tests_ok/json_output.hurl","success":true,"time":~~~} diff --git a/integration/tests_ok/retry.err.pattern b/integration/tests_ok/retry.err.pattern new file mode 100644 index 000000000..9fe252367 --- /dev/null +++ b/integration/tests_ok/retry.err.pattern @@ -0,0 +1,244 @@ +* Options: +* fail fast: true +* follow redirect: false +* insecure: false +* max redirect: 50 +* retry: true +* ------------------------------------------------------------------------------ +* Executing entry 1 +* +* Cookie store: +* +* Request: +* POST http://localhost:8000/jobs +* +* Request can be run with the following curl command: +* curl 'http://localhost:8000/jobs' -X POST +* +> POST /jobs HTTP/1.1 +> Host: localhost:8000 +> Accept: */* +> User-Agent: hurl/~~~ +> +* Response: (received 60 bytes in ~~~ ms) +* +< HTTP/1.0 201 CREATED +< Content-Type: application/json +< Content-Length: 60 +< Server: Flask Server +< Date: ~~~ +< +* Captures: +* job_id: ~~~ +* +* ------------------------------------------------------------------------------ +* Executing entry 2 +* +* Cookie store: +* +* Request: +* GET http://localhost:8000/jobs/~~~ +* +* Request can be run with the following curl command: +* curl 'http://localhost:8000/jobs/~~~' +* +> GET /jobs/~~~ HTTP/1.1 +> Host: localhost:8000 +> Accept: */* +> User-Agent: hurl/~~~ +> +* Response: (received 60 bytes in ~~~ ms) +* +< HTTP/1.0 200 OK +< Content-Type: application/json +< Content-Length: 60 +< Server: Flask Server +< Date: ~~~ +< +* +* Assert failure +* --> tests_ok/retry.hurl:16:0 +* | +* 16 | jsonpath "$.state" == "COMPLETED" +* | actual: string +* | expected: string +* | +* +* Retry entry 2 (x1 pause 100 ms) +* ------------------------------------------------------------------------------ +* Executing entry 2 +* +* Cookie store: +* +* Request: +* GET http://localhost:8000/jobs/~~~ +* +* Request can be run with the following curl command: +* curl 'http://localhost:8000/jobs/~~~' +* +> GET /jobs/~~~ HTTP/1.1 +> Host: localhost:8000 +> Accept: */* +> User-Agent: hurl/~~~ +> +* Response: (received 60 bytes in ~~~ ms) +* +< HTTP/1.0 200 OK +< Content-Type: application/json +< Content-Length: 60 +< Server: Flask Server +< Date: ~~~ +< +* +* Assert failure +* --> tests_ok/retry.hurl:16:0 +* | +* 16 | jsonpath "$.state" == "COMPLETED" +* | actual: string +* | expected: string +* | +* +* Retry entry 2 (x2 pause 100 ms) +* ------------------------------------------------------------------------------ +* Executing entry 2 +* +* Cookie store: +* +* Request: +* GET http://localhost:8000/jobs/~~~ +* +* Request can be run with the following curl command: +* curl 'http://localhost:8000/jobs/~~~' +* +> GET /jobs/~~~ HTTP/1.1 +> Host: localhost:8000 +> Accept: */* +> User-Agent: hurl/~~~ +> +* Response: (received 60 bytes in ~~~ ms) +* +< HTTP/1.0 200 OK +< Content-Type: application/json +< Content-Length: 60 +< Server: Flask Server +< Date: ~~~ +< +* +* Assert failure +* --> tests_ok/retry.hurl:16:0 +* | +* 16 | jsonpath "$.state" == "COMPLETED" +* | actual: string +* | expected: string +* | +* +* Retry entry 2 (x3 pause 100 ms) +* ------------------------------------------------------------------------------ +* Executing entry 2 +* +* Cookie store: +* +* Request: +* GET http://localhost:8000/jobs/~~~ +* +* Request can be run with the following curl command: +* curl 'http://localhost:8000/jobs/~~~' +* +> GET /jobs/~~~ HTTP/1.1 +> Host: localhost:8000 +> Accept: */* +> User-Agent: hurl/~~~ +> +* Response: (received 60 bytes in ~~~ ms) +* +< HTTP/1.0 200 OK +< Content-Type: application/json +< Content-Length: 60 +< Server: Flask Server +< Date: ~~~ +< +* +* Assert failure +* --> tests_ok/retry.hurl:16:0 +* | +* 16 | jsonpath "$.state" == "COMPLETED" +* | actual: string +* | expected: string +* | +* +* Retry entry 2 (x4 pause 100 ms) +* ------------------------------------------------------------------------------ +* Executing entry 2 +* +* Cookie store: +* +* Request: +* GET http://localhost:8000/jobs/~~~ +* +* Request can be run with the following curl command: +* curl 'http://localhost:8000/jobs/~~~' +* +> GET /jobs/~~~ HTTP/1.1 +> Host: localhost:8000 +> Accept: */* +> User-Agent: hurl/~~~ +> +* Response: (received 62 bytes in ~~~ ms) +* +< HTTP/1.0 200 OK +< Content-Type: application/json +< Content-Length: 62 +< Server: Flask Server +< Date: ~~~ +< +* +* ------------------------------------------------------------------------------ +* Executing entry 3 +* +* Cookie store: +* +* Request: +* DELETE http://localhost:8000/jobs/~~~ +* +* Request can be run with the following curl command: +* curl 'http://localhost:8000/jobs/~~~' -X DELETE +* +> DELETE /jobs/~~~ HTTP/1.1 +> Host: localhost:8000 +> Accept: */* +> User-Agent: hurl/~~~ +> +* Response: (received 0 bytes in ~~~ ms) +* +< HTTP/1.0 200 OK +< Content-Type: application/json +< Server: Flask Server +< Content-Length: 0 +< Date: ~~~ +< +* +* ------------------------------------------------------------------------------ +* Executing entry 4 +* +* Cookie store: +* +* Request: +* GET http://localhost:8000/jobs/~~~ +* +* Request can be run with the following curl command: +* curl 'http://localhost:8000/jobs/~~~' +* +> GET /jobs/~~~ HTTP/1.1 +> Host: localhost:8000 +> Accept: */* +> User-Agent: hurl/~~~ +> +* Response: (received 42 bytes in ~~~ ms) +* +< HTTP/1.0 404 NOT FOUND +< Content-Type: application/json +< Content-Length: 42 +< Server: Flask Server +< Date: ~~~ +< +* diff --git a/integration/tests_ok/retry.html b/integration/tests_ok/retry.html new file mode 100644 index 000000000..132d9bd07 --- /dev/null +++ b/integration/tests_ok/retry.html @@ -0,0 +1,25 @@ +
# Create a new job
+POST http://localhost:8000/jobs
+
+HTTP/* 201
+[Captures]
+job_id: jsonpath "$.id"
+[Asserts]
+jsonpath "$.state" == "RUNNING"
+
+
+# Pull job status until it is completed
+GET http://localhost:8000/jobs/{{job_id}}
+
+HTTP/* 200
+[Asserts]
+jsonpath "$.state" == "COMPLETED"
+
+
+# Delete the job
+DELETE http://localhost:8000/jobs/{{job_id}}
+HTTP/* 200
+
+GET http://localhost:8000/jobs/{{job_id}}
+HTTP/* 404
+
\ No newline at end of file diff --git a/integration/tests_ok/retry.hurl b/integration/tests_ok/retry.hurl new file mode 100644 index 000000000..80f669cdc --- /dev/null +++ b/integration/tests_ok/retry.hurl @@ -0,0 +1,24 @@ +# Create a new job +POST http://localhost:8000/jobs + +HTTP/* 201 +[Captures] +job_id: jsonpath "$.id" +[Asserts] +jsonpath "$.state" == "RUNNING" + + +# Pull job status until it is completed +GET http://localhost:8000/jobs/{{job_id}} + +HTTP/* 200 +[Asserts] +jsonpath "$.state" == "COMPLETED" + + +# Delete the job +DELETE http://localhost:8000/jobs/{{job_id}} +HTTP/* 200 + +GET http://localhost:8000/jobs/{{job_id}} +HTTP/* 404 diff --git a/integration/tests_ok/retry.json b/integration/tests_ok/retry.json new file mode 100644 index 000000000..182e718ea --- /dev/null +++ b/integration/tests_ok/retry.json @@ -0,0 +1 @@ +{"entries":[{"request":{"method":"POST","url":"http://localhost:8000/jobs"},"response":{"status":201,"captures":[{"name":"job_id","query":{"type":"jsonpath","expr":"$.id"}}],"asserts":[{"query":{"type":"jsonpath","expr":"$.state"},"predicate":{"type":"equal","value":"RUNNING"}}]}},{"request":{"method":"GET","url":"http://localhost:8000/jobs/{{job_id}}"},"response":{"status":200,"asserts":[{"query":{"type":"jsonpath","expr":"$.state"},"predicate":{"type":"equal","value":"COMPLETED"}}]}},{"request":{"method":"DELETE","url":"http://localhost:8000/jobs/{{job_id}}"},"response":{"status":200}},{"request":{"method":"GET","url":"http://localhost:8000/jobs/{{job_id}}"},"response":{"status":404}}]} \ No newline at end of file diff --git a/integration/tests_ok/retry.options b/integration/tests_ok/retry.options new file mode 100644 index 000000000..6a809ba3b --- /dev/null +++ b/integration/tests_ok/retry.options @@ -0,0 +1,5 @@ +--retry +--retry-interval +100 +--verbose +--json \ No newline at end of file diff --git a/integration/tests_ok/retry.out.pattern b/integration/tests_ok/retry.out.pattern new file mode 100644 index 000000000..480f9251d --- /dev/null +++ b/integration/tests_ok/retry.out.pattern @@ -0,0 +1 @@ +{"cookies":[],"entries":[{"asserts":[{"line":4,"success":true},{"line":4,"success":true},{"line":8,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"POST","queryString":[],"url":"http://localhost:8000/jobs"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":201}}],"captures":[{"name":"job_id","value":"~~~"}],"index":1,"time":~~~},{"asserts":[{"line":14,"success":true},{"line":14,"success":true},{"line":16,"message":"Assert failure\n --> tests_ok/retry.hurl:16:0\n |\n16 | 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","queryString":[],"url":"http://localhost:8000/jobs/~~~"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":2,"time":~~~},{"asserts":[{"line":14,"success":true},{"line":14,"success":true},{"line":16,"message":"Assert failure\n --> tests_ok/retry.hurl:16:0\n |\n16 | 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","queryString":[],"url":"http://localhost:8000/jobs/~~~"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":2,"time":~~~},{"asserts":[{"line":14,"success":true},{"line":14,"success":true},{"line":16,"message":"Assert failure\n --> tests_ok/retry.hurl:16:0\n |\n16 | 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","queryString":[],"url":"http://localhost:8000/jobs/~~~"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":2,"time":~~~},{"asserts":[{"line":14,"success":true},{"line":14,"success":true},{"line":16,"message":"Assert failure\n --> tests_ok/retry.hurl:16:0\n |\n16 | 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","queryString":[],"url":"http://localhost:8000/jobs/~~~"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"60"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":2,"time":~~~},{"asserts":[{"line":14,"success":true},{"line":14,"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","queryString":[],"url":"http://localhost:8000/jobs/~~~"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"62"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":2,"time":~~~},{"asserts":[{"line":21,"success":true},{"line":21,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"DELETE","queryString":[],"url":"http://localhost:8000/jobs/~~~"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"Server","value":"Flask Server"},{"name":"Content-Length","value":"0"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":200}}],"captures":[],"index":3,"time":~~~},{"asserts":[{"line":24,"success":true},{"line":24,"success":true}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/jobs/~~~"},"response":{"cookies":[],"headers":[{"name":"Content-Type","value":"application/json"},{"name":"Content-Length","value":"42"},{"name":"Server","value":"Flask Server"},{"name":"Date","value":"~~~"}],"httpVersion":"HTTP/1.0","status":404}}],"captures":[],"index":4,"time":~~~}],"filename":"tests_ok/retry.hurl","success":true,"time":~~~} diff --git a/integration/tests_ok/retry.py b/integration/tests_ok/retry.py new file mode 100644 index 000000000..60237cddf --- /dev/null +++ b/integration/tests_ok/retry.py @@ -0,0 +1,39 @@ +import json +import uuid +from http import HTTPStatus +from app import app +from flask import Response + +jobs = {} + + +@app.route("/jobs", methods=["POST"]) +def new_job(): + job_id = uuid.uuid4().hex + job = {"id": job_id, "state": "RUNNING", "count": 0} + jobs[job_id] = job + + data = {"id": job_id, "state": "RUNNING"} + return data, HTTPStatus.CREATED + + +@app.route("/jobs/") +def get_job(job_id): + job = jobs.get(job_id) + if not job: + data = {"error": "404", "message": "job not found"} + return data, HTTPStatus.NOT_FOUND + + if job["state"] == "RUNNING": + job["count"] = job["count"] + 1 + if job["count"] >= 5: + job["state"] = "COMPLETED" + + data = {"id": job_id, "state": job["state"]} + return data + + +@app.route("/jobs/", methods=["DELETE"]) +def delete_job(job_id): + jobs.pop(job_id) + return Response(status=HTTPStatus.OK, mimetype="application/json") diff --git a/integration/tests_ok/verbose.err.pattern b/integration/tests_ok/verbose.err.pattern index b52cbae11..3e60a290a 100644 --- a/integration/tests_ok/verbose.err.pattern +++ b/integration/tests_ok/verbose.err.pattern @@ -1,8 +1,9 @@ * Options: * fail fast: true -* insecure: false * follow redirect: false +* insecure: false * max redirect: 50 +* retry: false * ------------------------------------------------------------------------------ * Executing entry 1 * diff --git a/integration/tests_ok/very_verbose.err.pattern b/integration/tests_ok/very_verbose.err.pattern index aea2d9930..ff0145742 100644 --- a/integration/tests_ok/very_verbose.err.pattern +++ b/integration/tests_ok/very_verbose.err.pattern @@ -1,8 +1,9 @@ * Options: * fail fast: true -* insecure: false * follow redirect: true +* insecure: false * max redirect: 50 +* retry: false * ------------------------------------------------------------------------------ * Executing entry 1 *