Skip to content

Commit

Permalink
Add curl debug command to --json and JSON report
Browse files Browse the repository at this point in the history
  • Loading branch information
jcamiel committed Nov 6, 2024
1 parent 7fc2d56 commit 12669f4
Show file tree
Hide file tree
Showing 37 changed files with 85 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Invalid decoding\n --> tests_failed/assert_match_utf8.hurl:4:1\n |\n | GET http://localhost:8000/error-assert/match-utf8\n | ...\n 4 | body matches \".*\"\n | ^^^^ the body can not be decoded with charset 'utf-8'\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-assert/match-utf8"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"1"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/assert_match_utf8.hurl","success":false,"time":<<<\d+>>>}
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Invalid decoding\n --> tests_failed/assert_match_utf8.hurl:4:1\n |\n | GET http://localhost:8000/error-assert/match-utf8\n | ...\n 4 | body matches \".*\"\n | ^^^^ the body can not be decoded with charset 'utf-8'\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-assert/match-utf8"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"1"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/error-assert/match-utf8'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/assert_match_utf8.hurl","success":false,"time":<<<\d+>>>}
2 changes: 1 addition & 1 deletion integration/hurl/tests_failed/assert_status.out.pattern
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"cookies":[],"entries":[{"asserts":[{"line":9,"success":true},{"line":9,"message":"Assert status code\n --> tests_failed/assert_status.hurl:9:6\n |\n | GET http://localhost:8000/not_found\n | ...\n 9 | HTTP 200\n | ^^^ actual value is <404>\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/not_found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"207"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":404},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":7,"time":<<<\d+>>>}],"filename":"tests_failed/assert_status.hurl","success":false,"time":<<<\d+>>>}
{"cookies":[],"entries":[{"asserts":[{"line":9,"success":true},{"line":9,"message":"Assert status code\n --> tests_failed/assert_status.hurl:9:6\n |\n | GET http://localhost:8000/not_found\n | ...\n 9 | HTTP 200\n | ^^^ actual value is <404>\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/not_found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"207"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":404},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/not_found'","index":1,"line":7,"time":<<<\d+>>>}],"filename":"tests_failed/assert_status.hurl","success":false,"time":<<<\d+>>>}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Undefined variable\n --> tests_failed/assert_template_variable_not_found.hurl:4:29\n |\n | GET http://localhost:8000/error-assert-template-variable-not-found\n | ...\n 4 | header \"content-type\" == \"{{content_type}}\"\n | ^^^^^^^^^^^^ you must set the variable content_type\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-assert-template-variable-not-found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/assert_template_variable_not_found.hurl","success":false,"time":<<<\d+>>>}
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Undefined variable\n --> tests_failed/assert_template_variable_not_found.hurl:4:29\n |\n | GET http://localhost:8000/error-assert-template-variable-not-found\n | ...\n 4 | header \"content-type\" == \"{{content_type}}\"\n | ^^^^^^^^^^^^ you must set the variable content_type\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-assert-template-variable-not-found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/error-assert-template-variable-not-found'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/assert_template_variable_not_found.hurl","success":false,"time":<<<\d+>>>}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'

hurl --json tests_failed/assert_template_variable_not_found.hurl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
set -Eeuo pipefail

hurl --json tests_failed/assert_template_variable_not_found.hurl
3 changes: 2 additions & 1 deletion integration/hurl/tests_failed/assert_value_error.out.pattern
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"headers": [
{
"name": "Server",
"value": "Werkzeug/<<<.*?>>>"
"value": "Werkzeug/<<<.*?>>> Python/<<<.*?>>>"
},
{
"name": "Date",
Expand Down Expand Up @@ -123,6 +123,7 @@
}
],
"captures": [],
"curl_cmd": "curl 'http://localhost:8000/error-assert-value'",
"index": 1,
"line": 1,
"time": <<<\d+>>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"message":"Header not found\n --> tests_failed/query_header_not_found.hurl:3:1\n |\n | GET http://localhost:8000/error-query-header-not-found\n | ...\n 3 | Custom: XXX\n | ^^^^^^ this header has not been found in the response\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-query-header-not-found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/query_header_not_found.hurl","success":false,"time":<<<\d+>>>}
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":3,"message":"Header not found\n --> tests_failed/query_header_not_found.hurl:3:1\n |\n | GET http://localhost:8000/error-query-header-not-found\n | ...\n 3 | Custom: XXX\n | ^^^^^^ this header has not been found in the response\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/<<<.*?>>>"}],"method":"GET","query_string":[],"url":"http://localhost:8000/error-query-header-not-found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/<<<.*?>>> Python/<<<.*?>>>"},{"name":"Date","value":"<<<.*?>>>"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"12"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"http_version":"HTTP/1.1","status":200},"timings":{"app_connect":<<<\d+>>>,"begin_call":"<<<.*?>>>","connect":<<<\d+>>>,"end_call":"<<<.*?>>>","name_lookup":<<<\d+>>>,"pre_transfer":<<<\d+>>>,"start_transfer":<<<\d+>>>,"total":<<<\d+>>>}}],"captures":[],"curl_cmd":"curl 'http://localhost:8000/error-query-header-not-found'","index":1,"line":1,"time":<<<\d+>>>}],"filename":"tests_failed/query_header_not_found.hurl","success":false,"time":<<<\d+>>>}
Loading

0 comments on commit 12669f4

Please sign in to comment.