From 7f561566dcf12cdce18e2fa633407104a5bb687e Mon Sep 17 00:00:00 2001 From: jcamiel Date: Mon, 8 Aug 2022 18:33:49 +0200 Subject: [PATCH] Normalize acronym case in errors. --- .../ssl/error_self_signed_certificate.err | 2 +- ...r_self_signed_certificate.linux-fedora.err | 2 +- .../error_self_signed_certificate.windows.err | 2 +- .../tests_error_parser/duplicate_section.err | 2 +- integration/tests_error_parser/file.err | 2 +- .../invalid_character_at_end.err | 4 +- .../tests_error_parser/invalid_cookiepath.err | 2 +- .../tests_error_parser/invalid_escape.err | 2 +- .../tests_error_parser/invalid_regex.err | 2 +- .../tests_error_parser/invalid_url.err | 4 +- integration/tests_error_parser/json.err | 4 +- .../json_unexpected_character.err | 4 +- .../json_unexpected_eof.err | 4 +- integration/tests_error_parser/method.err | 4 +- integration/tests_error_parser/status.err | 4 +- integration/tests_error_parser/version.err | 4 +- integration/tests_failed/assert_base64.err | 2 +- integration/tests_failed/assert_bytearray.err | 4 +- .../tests_failed/assert_content_encoding.err | 4 +- .../tests_failed/assert_decompress.err | 4 +- integration/tests_failed/assert_file.err | 2 +- .../tests_failed/assert_header_not_found.err | 4 +- .../tests_failed/assert_header_value.err | 2 +- .../tests_failed/assert_http_version.err | 2 +- .../assert_invalid_predicate_type.err | 2 +- .../tests_failed/assert_match_utf8.err | 4 +- .../assert_match_utf8.output.json | 2 +- integration/tests_failed/assert_newline.err | 2 +- .../tests_failed/assert_query_cookie.err | 6 +- .../assert_query_invalid_regex.err | 2 +- .../assert_query_invalid_xpath.err | 4 +- integration/tests_failed/assert_status.err | 2 +- .../tests_failed/assert_status.output.json | 2 +- .../assert_template_variable_not_found.err | 4 +- ...rt_template_variable_not_found.output.json | 2 +- .../tests_failed/assert_value_error.err | 16 +-- .../assert_value_error.output.json | 16 +-- integration/tests_failed/assert_variable.err | 10 +- integration/tests_failed/body_json.err | 2 +- integration/tests_failed/file_read_access.err | 4 +- .../tests_failed/file_unauthorized.err | 8 +- integration/tests_failed/http_connection.err | 2 +- integration/tests_failed/invalid_jsonpath.err | 4 +- integration/tests_failed/invalid_url.err | 2 +- integration/tests_failed/invalid_xml.err | 2 +- integration/tests_failed/max_redirect.err | 4 +- .../tests_failed/multipart_form_data.err | 4 +- .../tests_failed/output_decompress.err | 2 +- integration/tests_failed/predicate.err | 26 ++--- .../tests_failed/query_header_not_found.err | 4 +- .../query_header_not_found.output.json | 2 +- .../tests_failed/query_invalid_json.err | 4 +- .../tests_failed/query_invalid_utf8.err | 4 +- integration/tests_failed/query_match_none.err | 2 +- .../template_variable_not_found.err | 4 +- .../template_variable_not_renderable.err | 2 +- packages/hurl/src/report/junit/testcase.rs | 4 +- packages/hurl/src/runner/error.rs | 104 +++++++++--------- packages/hurl/src/util/logger.rs | 10 +- packages/hurl_core/src/error/mod.rs | 44 ++++---- 60 files changed, 195 insertions(+), 195 deletions(-) diff --git a/integration/ssl/error_self_signed_certificate.err b/integration/ssl/error_self_signed_certificate.err index e3922eef4..11fb3b331 100644 --- a/integration/ssl/error_self_signed_certificate.err +++ b/integration/ssl/error_self_signed_certificate.err @@ -1,4 +1,4 @@ -error: Http Connection +error: HTTP connection --> ssl/error_self_signed_certificate.hurl:1:5 | 1 | GET https://localhost:8001/hello diff --git a/integration/ssl/error_self_signed_certificate.linux-fedora.err b/integration/ssl/error_self_signed_certificate.linux-fedora.err index a337ee6e0..6b16a3d3e 100644 --- a/integration/ssl/error_self_signed_certificate.linux-fedora.err +++ b/integration/ssl/error_self_signed_certificate.linux-fedora.err @@ -1,4 +1,4 @@ -error: Http Connection +error: HTTP connection --> ssl/error_self_signed_certificate.hurl:1:5 | 1 | GET https://localhost:8001/hello diff --git a/integration/ssl/error_self_signed_certificate.windows.err b/integration/ssl/error_self_signed_certificate.windows.err index 8d57eb258..6ab18c2ae 100644 --- a/integration/ssl/error_self_signed_certificate.windows.err +++ b/integration/ssl/error_self_signed_certificate.windows.err @@ -1,4 +1,4 @@ -error: Http Connection +error: HTTP connection --> ssl/error_self_signed_certificate.hurl:1:5 | 1 | GET https://localhost:8001/hello diff --git a/integration/tests_error_parser/duplicate_section.err b/integration/tests_error_parser/duplicate_section.err index 53c7b78f9..3b105882f 100644 --- a/integration/tests_error_parser/duplicate_section.err +++ b/integration/tests_error_parser/duplicate_section.err @@ -2,6 +2,6 @@ error: Parsing section --> tests_error_parser/duplicate_section.hurl:4:1 | 4 | [QueryStringParams] - | ^ The section is already defined + | ^ the section is already defined | diff --git a/integration/tests_error_parser/file.err b/integration/tests_error_parser/file.err index bc83a0acc..504555313 100644 --- a/integration/tests_error_parser/file.err +++ b/integration/tests_error_parser/file.err @@ -1,4 +1,4 @@ -error: Parsing Filename +error: Parsing filename --> tests_error_parser/file.hurl:2:6 | 2 | file, diff --git a/integration/tests_error_parser/invalid_character_at_end.err b/integration/tests_error_parser/invalid_character_at_end.err index 1ab3b7c3c..25d2af683 100644 --- a/integration/tests_error_parser/invalid_character_at_end.err +++ b/integration/tests_error_parser/invalid_character_at_end.err @@ -1,7 +1,7 @@ -error: Parsing Method +error: Parsing method --> tests_error_parser/invalid_character_at_end.hurl:3:1 | 3 | XXX - | ^ The HTTP method is not valid. Available HTTP Methods are GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE or PATCH + | ^ the HTTP method is not valid. Available HTTP Methods are GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE or PATCH | diff --git a/integration/tests_error_parser/invalid_cookiepath.err b/integration/tests_error_parser/invalid_cookiepath.err index c03aa6be5..d9fa0ada2 100644 --- a/integration/tests_error_parser/invalid_cookiepath.err +++ b/integration/tests_error_parser/invalid_cookiepath.err @@ -2,6 +2,6 @@ error: Parsing cookie attribute --> tests_error_parser/invalid_cookiepath.hurl:4:17 | 4 | cookie "cookie1[X]" equals "1" - | ^ The cookie attribute is not valid + | ^ the cookie attribute is not valid | diff --git a/integration/tests_error_parser/invalid_escape.err b/integration/tests_error_parser/invalid_escape.err index 84a68d273..c63b0fc12 100644 --- a/integration/tests_error_parser/invalid_escape.err +++ b/integration/tests_error_parser/invalid_escape.err @@ -2,6 +2,6 @@ error: Parsing escape character --> tests_error_parser/invalid_escape.hurl:4:25 | 4 | xpath "//item" equals "\d\d\d\d-\d\d-\d\d" - | ^ The escaping sequence is not valid + | ^ the escaping sequence is not valid | diff --git a/integration/tests_error_parser/invalid_regex.err b/integration/tests_error_parser/invalid_regex.err index 6054fabe3..6ba6f624a 100644 --- a/integration/tests_error_parser/invalid_regex.err +++ b/integration/tests_error_parser/invalid_regex.err @@ -2,6 +2,6 @@ error: Parsing regex --> tests_error_parser/invalid_regex.hurl:4:23 | 4 | jsonpath "$.data" == /aa{a}/ - | ^ Invalid Regex expression: repetition quantifier expects a valid decimal + | ^ invalid Regex expression: repetition quantifier expects a valid decimal | diff --git a/integration/tests_error_parser/invalid_url.err b/integration/tests_error_parser/invalid_url.err index a288f8e08..94699e96b 100644 --- a/integration/tests_error_parser/invalid_url.err +++ b/integration/tests_error_parser/invalid_url.err @@ -1,7 +1,7 @@ -error: Parsing url +error: Parsing URL --> tests_error_parser/invalid_url.hurl:1:26 | 1 | GET http://localhost:8000> # - | ^ Illegal character <>> + | ^ illegal character <>> | diff --git a/integration/tests_error_parser/json.err b/integration/tests_error_parser/json.err index 76e6fd3db..487f6970e 100644 --- a/integration/tests_error_parser/json.err +++ b/integration/tests_error_parser/json.err @@ -1,7 +1,7 @@ -error: Parsing json +error: Parsing JSON --> tests_error_parser/json.hurl:2:10 | 2 | { "name": - | ^ json error + | ^ JSON error | diff --git a/integration/tests_error_parser/json_unexpected_character.err b/integration/tests_error_parser/json_unexpected_character.err index da9538369..cfd832109 100644 --- a/integration/tests_error_parser/json_unexpected_character.err +++ b/integration/tests_error_parser/json_unexpected_character.err @@ -1,7 +1,7 @@ -error: Parsing json +error: Parsing JSON --> tests_error_parser/json_unexpected_character.hurl:2:10 | 2 | { "name": x - | ^ json error + | ^ JSON error | diff --git a/integration/tests_error_parser/json_unexpected_eof.err b/integration/tests_error_parser/json_unexpected_eof.err index 827d42f51..fa4000dbf 100644 --- a/integration/tests_error_parser/json_unexpected_eof.err +++ b/integration/tests_error_parser/json_unexpected_eof.err @@ -1,6 +1,6 @@ -error: Parsing json +error: Parsing JSON --> tests_error_parser/json_unexpected_eof.hurl:2:10 | 2 | { "name": - | ^ json error + | ^ JSON error | \ No newline at end of file diff --git a/integration/tests_error_parser/method.err b/integration/tests_error_parser/method.err index 562150806..fd7310fa4 100644 --- a/integration/tests_error_parser/method.err +++ b/integration/tests_error_parser/method.err @@ -1,7 +1,7 @@ -error: Parsing Method +error: Parsing method --> tests_error_parser/method.hurl:1:1 | 1 | GeT http://localhost:8000/hello - | ^ The HTTP method is not valid. Did you mean GET? + | ^ the HTTP method is not valid. Did you mean GET? | diff --git a/integration/tests_error_parser/status.err b/integration/tests_error_parser/status.err index 6ff6678d2..2cc24da16 100644 --- a/integration/tests_error_parser/status.err +++ b/integration/tests_error_parser/status.err @@ -1,7 +1,7 @@ -error: Parsing Status +error: Parsing status code --> tests_error_parser/status.hurl:2:10 | 2 | HTTP/1.1 oa0 - | ^ The http status is not valid + | ^ HTTP status code is not valid | diff --git a/integration/tests_error_parser/version.err b/integration/tests_error_parser/version.err index e00e9e368..6f50a3d3b 100644 --- a/integration/tests_error_parser/version.err +++ b/integration/tests_error_parser/version.err @@ -1,7 +1,7 @@ -error: Parsing Version +error: Parsing version --> tests_error_parser/version.hurl:2:6 | 2 | HTTP/11 200 - | ^ The http version must be 1.0, 1.1, 2 or * + | ^ HTTP version must be 1.0, 1.1, 2 or * | diff --git a/integration/tests_failed/assert_base64.err b/integration/tests_failed/assert_base64.err index d8129bfc2..10d4ba5d2 100644 --- a/integration/tests_failed/assert_base64.err +++ b/integration/tests_failed/assert_base64.err @@ -1,4 +1,4 @@ -error: Assert Body Value +error: Assert body value --> tests_failed/assert_base64.hurl:12:8 | 12 | base64,bGluZTEKbGluZTIKbGluZTMK; diff --git a/integration/tests_failed/assert_bytearray.err b/integration/tests_failed/assert_bytearray.err index e9154d123..1ce17cad1 100644 --- a/integration/tests_failed/assert_bytearray.err +++ b/integration/tests_failed/assert_bytearray.err @@ -1,4 +1,4 @@ -error: Assert Failure +error: Assert failure --> tests_failed/assert_bytearray.hurl:4:0 | 4 | bytes equals hex,00; @@ -6,7 +6,7 @@ error: Assert Failure | expected: byte array <00> | -error: Assert Failure +error: Assert failure --> tests_failed/assert_bytearray.hurl:5:0 | 5 | sha256 equals hex,a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb88; diff --git a/integration/tests_failed/assert_content_encoding.err b/integration/tests_failed/assert_content_encoding.err index 314d7147d..f5099b652 100644 --- a/integration/tests_failed/assert_content_encoding.err +++ b/integration/tests_failed/assert_content_encoding.err @@ -1,7 +1,7 @@ -error: Decompression Error +error: Decompression error --> tests_failed/assert_content_encoding.hurl:4:1 | 4 | ```Hello World!``` - | ^ Compression unknown is not supported + | ^ compression unknown is not supported | diff --git a/integration/tests_failed/assert_decompress.err b/integration/tests_failed/assert_decompress.err index c2de7be79..1df85c7bb 100644 --- a/integration/tests_failed/assert_decompress.err +++ b/integration/tests_failed/assert_decompress.err @@ -1,7 +1,7 @@ -error: Decompression Error +error: Decompression error --> tests_failed/assert_decompress.hurl:3:1 | 3 | ```Hello World!``` - | ^ Could not uncompress response with gzip + | ^ could not uncompress response with gzip | diff --git a/integration/tests_failed/assert_file.err b/integration/tests_failed/assert_file.err index f1d4e0ff5..508093f4e 100644 --- a/integration/tests_failed/assert_file.err +++ b/integration/tests_failed/assert_file.err @@ -1,4 +1,4 @@ -error: Assert Body Value +error: Assert body value --> tests_failed/assert_file.hurl:8:1 | 8 | file,data.txt; diff --git a/integration/tests_failed/assert_header_not_found.err b/integration/tests_failed/assert_header_not_found.err index ad0d94314..da760db4b 100644 --- a/integration/tests_failed/assert_header_not_found.err +++ b/integration/tests_failed/assert_header_not_found.err @@ -1,7 +1,7 @@ -error: Header not Found +error: Header not found --> tests_failed/assert_header_not_found.hurl:3:1 | 3 | Custom: ??? - | ^^^^^^ This header has not been found in the response + | ^^^^^^ this header has not been found in the response | diff --git a/integration/tests_failed/assert_header_value.err b/integration/tests_failed/assert_header_value.err index 02515bad2..da8c2c0b9 100644 --- a/integration/tests_failed/assert_header_value.err +++ b/integration/tests_failed/assert_header_value.err @@ -1,4 +1,4 @@ -error: Assert Header Value +error: Assert header value --> tests_failed/assert_header_value.hurl:3:15 | 3 | Content-Type: ??? diff --git a/integration/tests_failed/assert_http_version.err b/integration/tests_failed/assert_http_version.err index 70e9e92ef..008bb7eef 100644 --- a/integration/tests_failed/assert_http_version.err +++ b/integration/tests_failed/assert_http_version.err @@ -1,4 +1,4 @@ -error: Assert Http Version +error: Assert HTTP version --> tests_failed/assert_http_version.hurl:2:6 | 2 | HTTP/2 200 diff --git a/integration/tests_failed/assert_invalid_predicate_type.err b/integration/tests_failed/assert_invalid_predicate_type.err index fbe1cb591..f663ddde0 100644 --- a/integration/tests_failed/assert_invalid_predicate_type.err +++ b/integration/tests_failed/assert_invalid_predicate_type.err @@ -1,4 +1,4 @@ -error: Assert Failure +error: Assert failure --> tests_failed/assert_invalid_predicate_type.hurl:4:0 | 4 | header "content-type" equals 1 diff --git a/integration/tests_failed/assert_match_utf8.err b/integration/tests_failed/assert_match_utf8.err index 89d864e3d..72dda42af 100644 --- a/integration/tests_failed/assert_match_utf8.err +++ b/integration/tests_failed/assert_match_utf8.err @@ -1,7 +1,7 @@ -error: Invalid Decoding +error: Invalid decoding --> tests_failed/assert_match_utf8.hurl:4:1 | 4 | body matches ".*" - | ^^^^ The body can not be decoded with charset 'utf-8' + | ^^^^ the body can not be decoded with charset 'utf-8' | diff --git a/integration/tests_failed/assert_match_utf8.output.json b/integration/tests_failed/assert_match_utf8.output.json index 2bd5a392f..6172f6519 100644 --- a/integration/tests_failed/assert_match_utf8.output.json +++ b/integration/tests_failed/assert_match_utf8.output.json @@ -21,7 +21,7 @@ }, { "success": false, - "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 |", + "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 |", "line": 4 } ] diff --git a/integration/tests_failed/assert_newline.err b/integration/tests_failed/assert_newline.err index 75a031e7b..ad1a8d08b 100644 --- a/integration/tests_failed/assert_newline.err +++ b/integration/tests_failed/assert_newline.err @@ -1,4 +1,4 @@ -error: Assert Body Value +error: Assert body value --> tests_failed/assert_newline.hurl:9:4 | 9 | ```

Hello

diff --git a/integration/tests_failed/assert_query_cookie.err b/integration/tests_failed/assert_query_cookie.err index cfadb2794..f822f94bc 100644 --- a/integration/tests_failed/assert_query_cookie.err +++ b/integration/tests_failed/assert_query_cookie.err @@ -1,4 +1,4 @@ -error: Assert Failure +error: Assert failure --> tests_failed/assert_query_cookie.hurl:7:0 | 7 | cookie "cookie1[Secure]" equals false # This is not valid, Secure attribute exists or not but does have a value @@ -6,7 +6,7 @@ error: Assert Failure | expected: bool | -error: Assert Failure +error: Assert failure --> tests_failed/assert_query_cookie.hurl:11:0 | 11 | cookie "cookie2[Secure]" equals true # This is not valid, Secure attribute exists or not but does have a value @@ -15,7 +15,7 @@ error: Assert Failure | >>> types between actual and expected are not consistent | -error: Assert Failure +error: Assert failure --> tests_failed/assert_query_cookie.hurl:12:0 | 12 | cookie "cookie2[Secure]" not equals true # This is not valid, Secure attribute exists or not but does have a value diff --git a/integration/tests_failed/assert_query_invalid_regex.err b/integration/tests_failed/assert_query_invalid_regex.err index 8644cf9e4..0ff082ccd 100644 --- a/integration/tests_failed/assert_query_invalid_regex.err +++ b/integration/tests_failed/assert_query_invalid_regex.err @@ -2,6 +2,6 @@ error: Invalid regex --> tests_failed/assert_query_invalid_regex.hurl:4:7 | 4 | regex "[x" exists - | ^^^^ Regex expression is not valid + | ^^^^ regex expression is not valid | diff --git a/integration/tests_failed/assert_query_invalid_xpath.err b/integration/tests_failed/assert_query_invalid_xpath.err index c9e0c0885..4debbc8e9 100644 --- a/integration/tests_failed/assert_query_invalid_xpath.err +++ b/integration/tests_failed/assert_query_invalid_xpath.err @@ -1,7 +1,7 @@ -error: Invalid xpath expression +error: Invalid XPath expression --> tests_failed/assert_query_invalid_xpath.hurl:4:7 | 4 | xpath "//" equals 1 - | ^^^^ The xpath expression is not valid + | ^^^^ the XPath expression is not valid | diff --git a/integration/tests_failed/assert_status.err b/integration/tests_failed/assert_status.err index b039bfdea..c1e256e59 100644 --- a/integration/tests_failed/assert_status.err +++ b/integration/tests_failed/assert_status.err @@ -1,4 +1,4 @@ -error: Assert Status +error: Assert status code --> tests_failed/assert_status.hurl:2:10 | 2 | HTTP/1.0 200 diff --git a/integration/tests_failed/assert_status.output.json b/integration/tests_failed/assert_status.output.json index a5a959c28..a279c4b88 100644 --- a/integration/tests_failed/assert_status.output.json +++ b/integration/tests_failed/assert_status.output.json @@ -17,7 +17,7 @@ }, { "success": false, - "message": "Assert Status\n --> tests_failed/assert_status.hurl:2:10\n |\n 2 | HTTP/1.0 200\n | ^^^ actual value is <404>\n |", + "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 |", "line": 2 } ] diff --git a/integration/tests_failed/assert_template_variable_not_found.err b/integration/tests_failed/assert_template_variable_not_found.err index 409be7bf3..84889b75c 100644 --- a/integration/tests_failed/assert_template_variable_not_found.err +++ b/integration/tests_failed/assert_template_variable_not_found.err @@ -1,7 +1,7 @@ -error: Undefined Variable +error: Undefined variable --> tests_failed/assert_template_variable_not_found.hurl:4:33 | 4 | header "content-type" equals "{{content_type}}" - | ^^^^^^^^^^^^ You must set the variable content_type + | ^^^^^^^^^^^^ you must set the variable content_type | diff --git a/integration/tests_failed/assert_template_variable_not_found.output.json b/integration/tests_failed/assert_template_variable_not_found.output.json index e6cf07d58..38eff1c00 100644 --- a/integration/tests_failed/assert_template_variable_not_found.output.json +++ b/integration/tests_failed/assert_template_variable_not_found.output.json @@ -21,7 +21,7 @@ }, { "success": false, - "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 |", + "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 |", "line": 4 } ] diff --git a/integration/tests_failed/assert_value_error.err b/integration/tests_failed/assert_value_error.err index 4ac2d7244..46bfd2553 100644 --- a/integration/tests_failed/assert_value_error.err +++ b/integration/tests_failed/assert_value_error.err @@ -1,4 +1,4 @@ -error: Assert Failure +error: Assert failure --> tests_failed/assert_value_error.hurl:4:0 | 4 | header "content-type" equals "XXX" @@ -6,7 +6,7 @@ error: Assert Failure | expected: string | -error: Assert Failure +error: Assert failure --> tests_failed/assert_value_error.hurl:5:0 | 5 | header "content-type" notEquals "text/html; charset=utf-8" @@ -14,7 +14,7 @@ error: Assert Failure | expected: string | -error: Assert Failure +error: Assert failure --> tests_failed/assert_value_error.hurl:6:0 | 6 | jsonpath "$.id" equals "000001" @@ -22,7 +22,7 @@ error: Assert Failure | expected: string <000001> | -error: Assert Failure +error: Assert failure --> tests_failed/assert_value_error.hurl:7:0 | 7 | jsonpath "$.values" includes 100 @@ -30,7 +30,7 @@ error: Assert Failure | expected: includes int <100> | -error: Assert Failure +error: Assert failure --> tests_failed/assert_value_error.hurl:8:0 | 8 | jsonpath "$.values" not contains "Hello" @@ -39,7 +39,7 @@ error: Assert Failure | >>> types between actual and expected are not consistent | -error: Assert Failure +error: Assert failure --> tests_failed/assert_value_error.hurl:9:0 | 9 | jsonpath "$.count" greaterThan 5 @@ -47,7 +47,7 @@ error: Assert Failure | expected: greater than int <5> | -error: Assert Failure +error: Assert failure --> tests_failed/assert_value_error.hurl:10:0 | 10 | jsonpath "$.count" isFloat @@ -55,7 +55,7 @@ error: Assert Failure | expected: float | -error: Assert Failure +error: Assert failure --> tests_failed/assert_value_error.hurl:11:0 | 11 | bytes contains hex,00; diff --git a/integration/tests_failed/assert_value_error.output.json b/integration/tests_failed/assert_value_error.output.json index 2591fe625..9d425a0c5 100644 --- a/integration/tests_failed/assert_value_error.output.json +++ b/integration/tests_failed/assert_value_error.output.json @@ -21,42 +21,42 @@ }, { "success": false, - "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 |", + "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 |", "line": 4 }, { "success": false, - "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 |", + "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 |", "line": 5 }, { "success": false, - "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 |", + "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 |", "line": 6 }, { "success": false, - "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 |", + "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 |", "line": 7 }, { "success": false, - "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 |", + "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 |", "line": 8 }, { "success": false, - "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 |", + "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 |", "line": 9 }, { "success": false, - "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 |", + "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 |", "line": 10 }, { "success": false, - "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 |", + "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 |", "line": 11 } ] diff --git a/integration/tests_failed/assert_variable.err b/integration/tests_failed/assert_variable.err index 970b41463..848eeae40 100644 --- a/integration/tests_failed/assert_variable.err +++ b/integration/tests_failed/assert_variable.err @@ -1,4 +1,4 @@ -error: Assert Failure +error: Assert failure --> tests_failed/assert_variable.hurl:8:0 | 8 | variable "toto" equals "tata" @@ -6,14 +6,14 @@ error: Assert Failure | expected: string | -error: Undefined Variable +error: Undefined variable --> tests_failed/assert_variable.hurl:9:28 | 9 | variable "status" equals {{unknown}} - | ^^^^^^^ You must set the variable unknown + | ^^^^^^^ you must set the variable unknown | -error: Assert Failure +error: Assert failure --> tests_failed/assert_variable.hurl:10:0 | 10 | variable "status" equals {{type}} @@ -21,7 +21,7 @@ error: Assert Failure | expected: string | -error: Assert Failure +error: Assert failure --> tests_failed/assert_variable.hurl:11:0 | 11 | variable "status" equals {{length}} diff --git a/integration/tests_failed/body_json.err b/integration/tests_failed/body_json.err index 8a2e967f7..f02057b38 100644 --- a/integration/tests_failed/body_json.err +++ b/integration/tests_failed/body_json.err @@ -1,4 +1,4 @@ -error: Invalid Json +error: Invalid JSON --> tests_failed/body_json.hurl:3:18 | 3 | "success": {{success}} diff --git a/integration/tests_failed/file_read_access.err b/integration/tests_failed/file_read_access.err index 58ce06cae..b89b17822 100644 --- a/integration/tests_failed/file_read_access.err +++ b/integration/tests_failed/file_read_access.err @@ -1,7 +1,7 @@ -error: File ReadAccess +error: File read access --> tests_failed/file_read_access.hurl:2:6 | 2 | file,does_not_exist; - | ^^^^^^^^^^^^^^ File does_not_exist can not be read + | ^^^^^^^^^^^^^^ file does_not_exist can not be read | diff --git a/integration/tests_failed/file_unauthorized.err b/integration/tests_failed/file_unauthorized.err index fcfe61c9e..fa256a3c2 100644 --- a/integration/tests_failed/file_unauthorized.err +++ b/integration/tests_failed/file_unauthorized.err @@ -2,26 +2,26 @@ error: Unauthorized file access --> tests_failed/file_unauthorized.hurl:2:6 | 2 | file,/secret.txt; - | ^^^^^^^^^^^ Unauthorized access to file /secret.txt, check --file-root option + | ^^^^^^^^^^^ unauthorized access to file /secret.txt, check --file-root option | error: Unauthorized file access --> tests_failed/file_unauthorized.hurl:7:6 | 7 | file,../secret.txt; - | ^^^^^^^^^^^^^ Unauthorized access to file ../secret.txt, check --file-root option + | ^^^^^^^^^^^^^ unauthorized access to file ../secret.txt, check --file-root option | error: Unauthorized file access --> tests_failed/file_unauthorized.hurl:13:13 | 13 | file1: file,/secret.txt; - | ^^^^^^^^^^^ Unauthorized access to file /secret.txt, check --file-root option + | ^^^^^^^^^^^ unauthorized access to file /secret.txt, check --file-root option | error: Unauthorized file access --> tests_failed/file_unauthorized.hurl:19:13 | 19 | file1: file,../secret.txt; - | ^^^^^^^^^^^^^ Unauthorized access to file ../secret.txt, check --file-root option + | ^^^^^^^^^^^^^ unauthorized access to file ../secret.txt, check --file-root option | diff --git a/integration/tests_failed/http_connection.err b/integration/tests_failed/http_connection.err index 0d9c4e1de..642f327de 100644 --- a/integration/tests_failed/http_connection.err +++ b/integration/tests_failed/http_connection.err @@ -1,4 +1,4 @@ -error: Http Connection +error: HTTP connection --> tests_failed/http_connection.hurl:1:5 | 1 | GET http://unknown diff --git a/integration/tests_failed/invalid_jsonpath.err b/integration/tests_failed/invalid_jsonpath.err index a1087cae0..5aa898084 100644 --- a/integration/tests_failed/invalid_jsonpath.err +++ b/integration/tests_failed/invalid_jsonpath.err @@ -1,6 +1,6 @@ -error: Invalid jsonpath +error: Invalid JSONPath --> tests_failed/invalid_jsonpath.hurl:4:10 | 4 | jsonpath "" equals false - | ^^ the jsonpath expression '' is not valid + | ^^ the JSONPath expression '' is not valid | diff --git a/integration/tests_failed/invalid_url.err b/integration/tests_failed/invalid_url.err index 025e4eef2..731e05606 100644 --- a/integration/tests_failed/invalid_url.err +++ b/integration/tests_failed/invalid_url.err @@ -1,4 +1,4 @@ -error: Http Connection +error: HTTP connection --> tests_failed/invalid_url.hurl:1:5 | 1 | GET ??? diff --git a/integration/tests_failed/invalid_xml.err b/integration/tests_failed/invalid_xml.err index c47624c2c..e806109d6 100644 --- a/integration/tests_failed/invalid_xml.err +++ b/integration/tests_failed/invalid_xml.err @@ -2,6 +2,6 @@ error: Invalid XML --> tests_failed/invalid_xml.hurl:4:1 | 4 | xpath "xx" equals 1 - | ^^^^^^^^^^ The Http response is not a valid XML + | ^^^^^^^^^^ the HTTP response is not a valid XML | diff --git a/integration/tests_failed/max_redirect.err b/integration/tests_failed/max_redirect.err index f3c36ee94..f3dda206f 100644 --- a/integration/tests_failed/max_redirect.err +++ b/integration/tests_failed/max_redirect.err @@ -1,7 +1,7 @@ -error: Http Connection +error: HTTP connection --> tests_failed/max_redirect.hurl:1:5 | 1 | GET http://localhost:8000/redirect/7 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Too many redirect + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ too many redirect | diff --git a/integration/tests_failed/multipart_form_data.err b/integration/tests_failed/multipart_form_data.err index e99f70cbc..60f618904 100644 --- a/integration/tests_failed/multipart_form_data.err +++ b/integration/tests_failed/multipart_form_data.err @@ -1,7 +1,7 @@ -error: File ReadAccess +error: File read access --> tests_failed/multipart_form_data.hurl:4:15 | 4 | upload1: file,unknown; - | ^^^^^^^ File unknown can not be read + | ^^^^^^^ file unknown can not be read | diff --git a/integration/tests_failed/output_decompress.err b/integration/tests_failed/output_decompress.err index 517999cd3..abd11cff1 100644 --- a/integration/tests_failed/output_decompress.err +++ b/integration/tests_failed/output_decompress.err @@ -1 +1 @@ -error: Could not uncompress response with gzip +error: could not uncompress response with gzip diff --git a/integration/tests_failed/predicate.err b/integration/tests_failed/predicate.err index 6de3184ea..be3a81168 100644 --- a/integration/tests_failed/predicate.err +++ b/integration/tests_failed/predicate.err @@ -1,4 +1,4 @@ -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:4:0 | 4 | jsonpath "$.status" equals "true" @@ -6,7 +6,7 @@ error: Assert Failure | expected: string | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:6:0 | 6 | jsonpath "$.count" equals 0 @@ -14,7 +14,7 @@ error: Assert Failure | expected: int <0> | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:7:0 | 7 | jsonpath "$.message" equals 0 @@ -22,7 +22,7 @@ error: Assert Failure | expected: int <0> | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:8:0 | 8 | jsonpath "$.empty" equals 0 @@ -30,7 +30,7 @@ error: Assert Failure | expected: int <0> | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:9:0 | 9 | jsonpath "$.number" equals 1.1 @@ -38,7 +38,7 @@ error: Assert Failure | expected: float <1.1> | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:10:0 | 10 | jsonpath "$.message" startsWith "hi" @@ -46,7 +46,7 @@ error: Assert Failure | expected: starts with string | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:11:0 | 11 | jsonpath "$.message" endsWith "hi" @@ -54,7 +54,7 @@ error: Assert Failure | expected: ends with string | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:12:0 | 12 | jsonpath "$.message" contains "hi" @@ -62,7 +62,7 @@ error: Assert Failure | expected: contains string | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:13:0 | 13 | jsonpath "$.message" matches "hi" @@ -74,10 +74,10 @@ error: Subquery error --> tests_failed/predicate.hurl:14:22 | 14 | jsonpath "$.message" count == 1 - | ^^^^^ Type from query result and subquery do not match + | ^^^^^ type from query result and subquery do not match | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:15:0 | 15 | jsonpath "$.toto" exists @@ -85,7 +85,7 @@ error: Assert Failure | expected: something | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:16:0 | 16 | jsonpath "$.message" not exists @@ -93,7 +93,7 @@ error: Assert Failure | expected: not something | -error: Assert Failure +error: Assert failure --> tests_failed/predicate.hurl:17:0 | 17 | jsonpath "$.list" count == 2 diff --git a/integration/tests_failed/query_header_not_found.err b/integration/tests_failed/query_header_not_found.err index 2329b15d1..faefe1c33 100644 --- a/integration/tests_failed/query_header_not_found.err +++ b/integration/tests_failed/query_header_not_found.err @@ -1,7 +1,7 @@ -error: Header not Found +error: Header not found --> tests_failed/query_header_not_found.hurl:3:1 | 3 | Custom: XXX - | ^^^^^^ This header has not been found in the response + | ^^^^^^ this header has not been found in the response | diff --git a/integration/tests_failed/query_header_not_found.output.json b/integration/tests_failed/query_header_not_found.output.json index cb12f133c..6208cff79 100644 --- a/integration/tests_failed/query_header_not_found.output.json +++ b/integration/tests_failed/query_header_not_found.output.json @@ -21,7 +21,7 @@ }, { "success": false, - "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 |", + "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 |", "line": 3 } ] diff --git a/integration/tests_failed/query_invalid_json.err b/integration/tests_failed/query_invalid_json.err index 9d739a45e..e4e3a77c1 100644 --- a/integration/tests_failed/query_invalid_json.err +++ b/integration/tests_failed/query_invalid_json.err @@ -1,7 +1,7 @@ -error: Invalid Json +error: Invalid JSON --> tests_failed/query_invalid_json.hurl:4:1 | 4 | jsonpath "$.errors" count == 2 - | ^^^^^^^^^^^^^^^^^^^ The http response is not a valid json + | ^^^^^^^^^^^^^^^^^^^ the HTTP response is not a valid JSON | diff --git a/integration/tests_failed/query_invalid_utf8.err b/integration/tests_failed/query_invalid_utf8.err index 714a64dea..c8c3263a8 100644 --- a/integration/tests_failed/query_invalid_utf8.err +++ b/integration/tests_failed/query_invalid_utf8.err @@ -1,7 +1,7 @@ -error: Invalid Decoding +error: Invalid decoding --> tests_failed/query_invalid_utf8.hurl:4:1 | 4 | jsonpath "$.errors" count == 2 - | ^^^^^^^^^^^^^^^^^^^ The body can not be decoded with charset 'utf-8' + | ^^^^^^^^^^^^^^^^^^^ the body can not be decoded with charset 'utf-8' | diff --git a/integration/tests_failed/query_match_none.err b/integration/tests_failed/query_match_none.err index 322c04539..b508da0ae 100644 --- a/integration/tests_failed/query_match_none.err +++ b/integration/tests_failed/query_match_none.err @@ -1,4 +1,4 @@ -error: Assert Failure +error: Assert failure --> tests_failed/query_match_none.hurl:4:0 | 4 | header "Location" matches /^foo$/ diff --git a/integration/tests_failed/template_variable_not_found.err b/integration/tests_failed/template_variable_not_found.err index b45afb001..fda06c42e 100644 --- a/integration/tests_failed/template_variable_not_found.err +++ b/integration/tests_failed/template_variable_not_found.err @@ -1,7 +1,7 @@ -error: Undefined Variable +error: Undefined variable --> tests_failed/template_variable_not_found.hurl:1:7 | 1 | GET {{url}} - | ^^^ You must set the variable url + | ^^^ you must set the variable url | diff --git a/integration/tests_failed/template_variable_not_renderable.err b/integration/tests_failed/template_variable_not_renderable.err index 2ea8390ee..2618c2659 100644 --- a/integration/tests_failed/template_variable_not_renderable.err +++ b/integration/tests_failed/template_variable_not_renderable.err @@ -1,4 +1,4 @@ -error: Unrenderable Variable +error: Unrenderable variable --> tests_failed/template_variable_not_renderable.hurl:8:11 | 8 | param1: {{list}} diff --git a/packages/hurl/src/report/junit/testcase.rs b/packages/hurl/src/report/junit/testcase.rs index 79ee6adca..1890247bf 100644 --- a/packages/hurl/src/report/junit/testcase.rs +++ b/packages/hurl/src/report/junit/testcase.rs @@ -157,7 +157,7 @@ HTTP/1.0 200 .unwrap(); assert_eq!( std::str::from_utf8(&buffer).unwrap(), - r#"Assert Status + r#"Assert status code --> test.hurl:2:10 | 2 | HTTP/1.0 200 @@ -197,7 +197,7 @@ HTTP/1.0 200 .unwrap(); assert_eq!( std::str::from_utf8(&buffer).unwrap(), - r#"Http Connection + r#"HTTP connection --> test.hurl:1:5 | 1 | GET http://unknown diff --git a/packages/hurl/src/runner/error.rs b/packages/hurl/src/runner/error.rs index b869385c2..d47c33072 100644 --- a/packages/hurl/src/runner/error.rs +++ b/packages/hurl/src/runner/error.rs @@ -12,76 +12,76 @@ impl Error for runner::Error { fn description(&self) -> String { match &self.inner { - RunnerError::InvalidUrl(..) => "Invalid url".to_string(), - RunnerError::TemplateVariableNotDefined { .. } => "Undefined Variable".to_string(), - RunnerError::VariableNotDefined { .. } => "Undefined Variable".to_string(), - RunnerError::HttpConnection { .. } => "Http Connection".to_string(), - RunnerError::CouldNotResolveProxyName => "Http Connection".to_string(), - RunnerError::CouldNotResolveHost(_) => "Http Connection".to_string(), - RunnerError::FailToConnect => "Http Connection".to_string(), - RunnerError::Timeout => "Http Connection".to_string(), - RunnerError::TooManyRedirect => "Http Connection".to_string(), - RunnerError::CouldNotParseResponse => "Http Connection".to_string(), - RunnerError::SslCertificate { .. } => "SSL Certificate".to_string(), - RunnerError::PredicateValue { .. } => "Assert - Predicate Value Failed".to_string(), + RunnerError::InvalidUrl(..) => "Invalid URL".to_string(), + RunnerError::TemplateVariableNotDefined { .. } => "Undefined variable".to_string(), + RunnerError::VariableNotDefined { .. } => "Undefined variable".to_string(), + RunnerError::HttpConnection { .. } => "HTTP connection".to_string(), + RunnerError::CouldNotResolveProxyName => "HTTP connection".to_string(), + RunnerError::CouldNotResolveHost(_) => "HTTP connection".to_string(), + RunnerError::FailToConnect => "HTTP connection".to_string(), + RunnerError::Timeout => "HTTP connection".to_string(), + RunnerError::TooManyRedirect => "HTTP connection".to_string(), + RunnerError::CouldNotParseResponse => "HTTP connection".to_string(), + RunnerError::SslCertificate { .. } => "SSL certificate".to_string(), + RunnerError::PredicateValue { .. } => "Assert - predicate value failed".to_string(), RunnerError::InvalidRegex {} => "Invalid regex".to_string(), - RunnerError::FileReadAccess { .. } => "File ReadAccess".to_string(), + RunnerError::FileReadAccess { .. } => "File read access".to_string(), RunnerError::QueryInvalidXml { .. } => "Invalid XML".to_string(), - RunnerError::QueryInvalidXpathEval {} => "Invalid xpath expression".to_string(), - RunnerError::QueryHeaderNotFound {} => "Header not Found".to_string(), - RunnerError::QueryCookieNotFound {} => "Cookie not Found".to_string(), - RunnerError::AssertHeaderValueError { .. } => "Assert Header Value".to_string(), - RunnerError::AssertBodyValueError { .. } => "Assert Body Value".to_string(), - RunnerError::AssertVersion { .. } => "Assert Http Version".to_string(), - RunnerError::AssertStatus { .. } => "Assert Status".to_string(), - RunnerError::QueryInvalidJson { .. } => "Invalid Json".to_string(), - RunnerError::QueryInvalidJsonpathExpression { .. } => "Invalid jsonpath".to_string(), - RunnerError::PredicateType { .. } => "Assert - Inconsistent predicate type".to_string(), + RunnerError::QueryInvalidXpathEval {} => "Invalid XPath expression".to_string(), + RunnerError::QueryHeaderNotFound {} => "Header not found".to_string(), + RunnerError::QueryCookieNotFound {} => "Cookie not found".to_string(), + RunnerError::AssertHeaderValueError { .. } => "Assert header value".to_string(), + RunnerError::AssertBodyValueError { .. } => "Assert body value".to_string(), + RunnerError::AssertVersion { .. } => "Assert HTTP version".to_string(), + RunnerError::AssertStatus { .. } => "Assert status code".to_string(), + RunnerError::QueryInvalidJson { .. } => "Invalid JSON".to_string(), + RunnerError::QueryInvalidJsonpathExpression { .. } => "Invalid JSONPath".to_string(), + RunnerError::PredicateType { .. } => "Assert - inconsistent predicate type".to_string(), RunnerError::SubqueryInvalidInput { .. } => "Subquery error".to_string(), - RunnerError::InvalidDecoding { .. } => "Invalid Decoding".to_string(), - RunnerError::InvalidCharset { .. } => "Invalid Charset".to_string(), - RunnerError::AssertFailure { .. } => "Assert Failure".to_string(), - RunnerError::UnrenderableVariable { .. } => "Unrenderable Variable".to_string(), + RunnerError::InvalidDecoding { .. } => "Invalid decoding".to_string(), + RunnerError::InvalidCharset { .. } => "Invalid charset".to_string(), + RunnerError::AssertFailure { .. } => "Assert failure".to_string(), + RunnerError::UnrenderableVariable { .. } => "Unrenderable variable".to_string(), RunnerError::NoQueryResult { .. } => "No query result".to_string(), - RunnerError::UnsupportedContentEncoding(..) => "Decompression Error".to_string(), - RunnerError::CouldNotUncompressResponse(..) => "Decompression Error".to_string(), - RunnerError::InvalidJson { .. } => "Invalid Json".to_string(), + RunnerError::UnsupportedContentEncoding(..) => "Decompression error".to_string(), + RunnerError::CouldNotUncompressResponse(..) => "Decompression error".to_string(), + RunnerError::InvalidJson { .. } => "Invalid JSON".to_string(), RunnerError::UnauthorizedFileAccess { .. } => "Unauthorized file access".to_string(), } } fn fixme(&self) -> String { match &self.inner { - RunnerError::InvalidUrl(url) => format!("Invalid url <{}>", url), + RunnerError::InvalidUrl(url) => format!("invalid URL <{}>", url), RunnerError::TemplateVariableNotDefined { name } => { - format!("You must set the variable {}", name) + format!("you must set the variable {}", name) } RunnerError::HttpConnection { message, .. } => message.to_string(), - RunnerError::CouldNotResolveProxyName => "Could not resolve proxy name".to_string(), - RunnerError::CouldNotResolveHost(host) => format!("Could not resolve host <{}>", host), - RunnerError::FailToConnect => "Fail to connect".to_string(), - RunnerError::Timeout => "Timeout has been reached".to_string(), - RunnerError::TooManyRedirect => "Too many redirect".to_string(), - RunnerError::CouldNotParseResponse => "Could not parse response".to_string(), + RunnerError::CouldNotResolveProxyName => "could not resolve proxy name".to_string(), + RunnerError::CouldNotResolveHost(host) => format!("could not resolve host <{}>", host), + RunnerError::FailToConnect => "fail to connect".to_string(), + RunnerError::Timeout => "timeout has been reached".to_string(), + RunnerError::TooManyRedirect => "too many redirect".to_string(), + RunnerError::CouldNotParseResponse => "could not parse response".to_string(), RunnerError::SslCertificate(description) => description.clone(), RunnerError::AssertVersion { actual, .. } => format!("actual value is <{}>", actual), RunnerError::AssertStatus { actual, .. } => format!("actual value is <{}>", actual), RunnerError::PredicateValue(value) => { format!("actual value is <{}>", value) } - RunnerError::InvalidRegex {} => "Regex expression is not valid".to_string(), - RunnerError::FileReadAccess { value } => format!("File {} can not be read", value), + RunnerError::InvalidRegex {} => "regex expression is not valid".to_string(), + RunnerError::FileReadAccess { value } => format!("file {} can not be read", value), RunnerError::QueryInvalidXml { .. } => { - "The Http response is not a valid XML".to_string() + "the HTTP response is not a valid XML".to_string() } RunnerError::QueryHeaderNotFound {} => { - "This header has not been found in the response".to_string() + "this header has not been found in the response".to_string() } RunnerError::QueryCookieNotFound {} => { - "This cookie has not been found in the response".to_string() + "this cookie has not been found in the response".to_string() } RunnerError::QueryInvalidXpathEval {} => { - "The xpath expression is not valid".to_string() + "the XPath expression is not valid".to_string() } RunnerError::AssertHeaderValueError { actual } => { format!("actual value is <{}>", actual) @@ -90,22 +90,22 @@ impl Error for runner::Error { format!("actual value is <{}>", actual) } RunnerError::QueryInvalidJson { .. } => { - "The http response is not a valid json".to_string() + "the HTTP response is not a valid JSON".to_string() } RunnerError::QueryInvalidJsonpathExpression { value } => { - format!("the jsonpath expression '{}' is not valid", value) + format!("the JSONPath expression '{}' is not valid", value) } RunnerError::PredicateType { .. } => { "predicate type inconsistent with value return by query".to_string() } RunnerError::SubqueryInvalidInput(t) => { - format!("Type <{}> from query result and subquery do not match", t) + format!("type <{}> from query result and subquery do not match", t) } RunnerError::InvalidDecoding { charset } => { - format!("The body can not be decoded with charset '{}'", charset) + format!("the body can not be decoded with charset '{}'", charset) } RunnerError::InvalidCharset { charset } => { - format!("The charset '{}' is not valid", charset) + format!("the charset '{}' is not valid", charset) } RunnerError::AssertFailure { actual, @@ -128,17 +128,17 @@ impl Error for runner::Error { } RunnerError::NoQueryResult { .. } => "The query didn't return any result".to_string(), RunnerError::UnsupportedContentEncoding(algorithm) => { - format!("Compression {} is not supported", algorithm) + format!("compression {} is not supported", algorithm) } RunnerError::CouldNotUncompressResponse(algorithm) => { - format!("Could not uncompress response with {}", algorithm) + format!("could not uncompress response with {}", algorithm) } RunnerError::InvalidJson { value } => { format!("actual value is <{}>", value) } RunnerError::UnauthorizedFileAccess { path } => { format!( - "Unauthorized access to file {}, check --file-root option", + "unauthorized access to file {}, check --file-root option", path.to_str().unwrap() ) } diff --git a/packages/hurl/src/util/logger.rs b/packages/hurl/src/util/logger.rs index a75882b90..3ec1b09bf 100644 --- a/packages/hurl/src/util/logger.rs +++ b/packages/hurl/src/util/logger.rs @@ -480,7 +480,7 @@ HTTP/1.0 200 }; assert_eq!( error_string(filename, content, &error, false), - r#"Assert Status + r#"Assert status code --> test.hurl:2:10 | 2 | HTTP/1.0 200 @@ -504,11 +504,11 @@ xpath "strong(//head/title)" equals "Hello" }; assert_eq!( error_string(filename, content, &error, false), - r#"Invalid xpath expression + r#"Invalid XPath expression --> test.hurl:4:7 | 4 | xpath "strong(//head/title)" equals "Hello" - | ^^^^^^^^^^^^^^^^^^^^^^ The xpath expression is not valid + | ^^^^^^^^^^^^^^^^^^^^^^ the XPath expression is not valid |"# ) } @@ -532,7 +532,7 @@ jsonpath "$.count" >= 5 }; assert_eq!( error_string(filename, content, &error, false), - r#"Assert Failure + r#"Assert failure --> test.hurl:4:0 | 4 | jsonpath "$.count" >= 5 @@ -560,7 +560,7 @@ HTTP/1.0 200 }; assert_eq!( error_string(filename, content, &error, false), - r#"Assert Body Value + r#"Assert body value --> test.hurl:3:4 | 3 | ```

Hello

diff --git a/packages/hurl_core/src/error/mod.rs b/packages/hurl_core/src/error/mod.rs index 0bdf5b37c..b4e9c0f2f 100644 --- a/packages/hurl_core/src/error/mod.rs +++ b/packages/hurl_core/src/error/mod.rs @@ -36,18 +36,18 @@ impl Error for parser::Error { fn description(&self) -> String { match self.clone().inner { - ParseError::Method { .. } => "Parsing Method".to_string(), - ParseError::Version { .. } => "Parsing Version".to_string(), - ParseError::Status { .. } => "Parsing Status".to_string(), - ParseError::Filename { .. } => "Parsing Filename".to_string(), + ParseError::Method { .. } => "Parsing method".to_string(), + ParseError::Version { .. } => "Parsing version".to_string(), + ParseError::Status { .. } => "Parsing status code".to_string(), + ParseError::Filename { .. } => "Parsing filename".to_string(), ParseError::Expecting { .. } => "Parsing literal".to_string(), ParseError::Space { .. } => "Parsing space".to_string(), ParseError::RequestSectionName { .. } => "Parsing request section name".to_string(), ParseError::ResponseSectionName { .. } => "Parsing response section name".to_string(), - ParseError::JsonpathExpr { .. } => "Parsing jsonpath expression".to_string(), - ParseError::XPathExpr { .. } => "Parsing xpath expression".to_string(), + ParseError::JsonpathExpr { .. } => "Parsing JSONPath expression".to_string(), + ParseError::XPathExpr { .. } => "Parsing XPath expression".to_string(), ParseError::TemplateVariable { .. } => "Parsing template variable".to_string(), - ParseError::Json { .. } => "Parsing json".to_string(), + ParseError::Json { .. } => "Parsing JSON".to_string(), ParseError::Predicate { .. } => "Parsing predicate".to_string(), ParseError::PredicateValue { .. } => "Parsing predicate value".to_string(), ParseError::RegexExpr { .. } => "Parsing regex".to_string(), @@ -57,7 +57,7 @@ impl Error for parser::Error { ParseError::EscapeChar { .. } => "Parsing escape character".to_string(), ParseError::InvalidCookieAttribute { .. } => "Parsing cookie attribute".to_string(), ParseError::OddNumberOfHexDigits { .. } => "Parsing hex bytearray".to_string(), - ParseError::UrlIllegalCharacter(_) => "Parsing url".to_string(), + ParseError::UrlIllegalCharacter(_) => "Parsing URL".to_string(), _ => format!("{:?}", self), } } @@ -65,13 +65,13 @@ impl Error for parser::Error { fn fixme(&self) -> String { match self.inner.clone() { ParseError::Method { name } - => format!("The HTTP method is not valid. {}", did_you_mean( + => format!("the HTTP method is not valid. {}", did_you_mean( &["GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"], name.as_str(), "Available HTTP Methods are GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE or PATCH", )), - ParseError::Version { .. } => "The http version must be 1.0, 1.1, 2 or *".to_string(), - ParseError::Status { .. } => "The http status is not valid".to_string(), + ParseError::Version { .. } => "HTTP version must be 1.0, 1.1, 2 or *".to_string(), + ParseError::Status { .. } => "HTTP status code is not valid".to_string(), ParseError::Filename { .. } => "expecting a filename".to_string(), ParseError::Expecting { value } => format!("expecting '{}'", value), ParseError::Space { .. } => "expecting a space".to_string(), @@ -87,28 +87,28 @@ impl Error for parser::Error { name.as_str(), "Valid values are Captures or Asserts", )), - ParseError::JsonpathExpr { .. } => "expecting a jsonpath expression".to_string(), - ParseError::XPathExpr { .. } => "expecting a xpath expression".to_string(), + ParseError::JsonpathExpr { .. } => "expecting a JSONPath expression".to_string(), + ParseError::XPathExpr { .. } => "expecting a XPath expression".to_string(), ParseError::TemplateVariable { .. } => "expecting a variable".to_string(), - ParseError::Json { .. } => "json error".to_string(), + ParseError::Json { .. } => "JSON error".to_string(), ParseError::Predicate { .. } => "expecting a predicate".to_string(), ParseError::PredicateValue { .. } => "invalid predicate value".to_string(), - ParseError::RegexExpr { message } => format!("Invalid Regex expression: {}", message), - ParseError::DuplicateSection { .. } => "The section is already defined".to_string(), + ParseError::RegexExpr { message } => format!("invalid Regex expression: {}", message), + ParseError::DuplicateSection { .. } => "the section is already defined".to_string(), ParseError::RequestSection { .. } => { - "This is not a valid section for a request".to_string() + "this is not a valid section for a request".to_string() } ParseError::ResponseSection { .. } => { - "This is not a valid section for a response".to_string() + "this is not a valid section for a response".to_string() } - ParseError::EscapeChar { .. } => "The escaping sequence is not valid".to_string(), + ParseError::EscapeChar { .. } => "the escaping sequence is not valid".to_string(), ParseError::InvalidCookieAttribute { .. } => { - "The cookie attribute is not valid".to_string() + "the cookie attribute is not valid".to_string() } ParseError::OddNumberOfHexDigits { .. } => { - "Expecting an even number of hex digits".to_string() + "expecting an even number of hex digits".to_string() } - ParseError::UrlIllegalCharacter(c) => format!("Illegal character <{}>", c), + ParseError::UrlIllegalCharacter(c) => format!("illegal character <{}>", c), _ => format!("{:?}", self), } }