From a81d86fb0539c4c75cbc946a9f05f79051cc3f12 Mon Sep 17 00:00:00 2001 From: Fabrice Reix Date: Wed, 7 Aug 2024 13:48:17 +0200 Subject: [PATCH] Update integ tests --- .../hurl/tests_error_parser/invalid_option_duration.err | 7 +++++++ .../hurl/tests_error_parser/invalid_option_duration.exit | 1 + .../hurl/tests_error_parser/invalid_option_duration.hurl | 4 ++++ .../hurl/tests_error_parser/invalid_option_duration.ps1 | 4 ++++ .../hurl/tests_error_parser/invalid_option_duration.sh | 4 ++++ integration/hurl/tests_failed/retry_option.err.pattern | 2 +- integration/hurl/tests_failed/retry_option.hurl | 2 +- integration/hurl/tests_ok/delay.hurl | 2 +- integration/hurl/tests_ok/delay_option.err.pattern | 2 +- integration/hurl/tests_ok/delay_option.hurl | 2 +- integration/hurl/tests_ok/parallel.err.pattern | 8 ++++---- integration/hurl/tests_ok/parallel.hurl | 2 +- integration/hurl/tests_ok/retry_option.err.pattern | 2 +- integration/hurl/tests_ok/retry_option.hurl | 2 +- integration/hurlfmt/tests_export/options.html | 4 ++++ integration/hurlfmt/tests_export/options.hurl | 4 ++++ integration/hurlfmt/tests_export/options.json | 2 +- integration/hurlfmt/tests_export/options.lint.hurl | 8 ++++++-- 18 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 integration/hurl/tests_error_parser/invalid_option_duration.err create mode 100644 integration/hurl/tests_error_parser/invalid_option_duration.exit create mode 100644 integration/hurl/tests_error_parser/invalid_option_duration.hurl create mode 100644 integration/hurl/tests_error_parser/invalid_option_duration.ps1 create mode 100755 integration/hurl/tests_error_parser/invalid_option_duration.sh diff --git a/integration/hurl/tests_error_parser/invalid_option_duration.err b/integration/hurl/tests_error_parser/invalid_option_duration.err new file mode 100644 index 000000000..74b80674c --- /dev/null +++ b/integration/hurl/tests_error_parser/invalid_option_duration.err @@ -0,0 +1,7 @@ +error: Parsing duration + --> tests_error_parser/invalid_option_duration.hurl:3:10 + | + 3 | delay: 10mms + | ^ the duration unit is not valid. Did you mean ms? + | + diff --git a/integration/hurl/tests_error_parser/invalid_option_duration.exit b/integration/hurl/tests_error_parser/invalid_option_duration.exit new file mode 100644 index 000000000..d8263ee98 --- /dev/null +++ b/integration/hurl/tests_error_parser/invalid_option_duration.exit @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/integration/hurl/tests_error_parser/invalid_option_duration.hurl b/integration/hurl/tests_error_parser/invalid_option_duration.hurl new file mode 100644 index 000000000..26be382ff --- /dev/null +++ b/integration/hurl/tests_error_parser/invalid_option_duration.hurl @@ -0,0 +1,4 @@ +GET https://localhost:8000/hello +[Options] +delay: 10mms +HTTP 200 diff --git a/integration/hurl/tests_error_parser/invalid_option_duration.ps1 b/integration/hurl/tests_error_parser/invalid_option_duration.ps1 new file mode 100644 index 000000000..a33fcdf31 --- /dev/null +++ b/integration/hurl/tests_error_parser/invalid_option_duration.ps1 @@ -0,0 +1,4 @@ +Set-StrictMode -Version latest +$ErrorActionPreference = 'Stop' + +hurl tests_error_parser/invalid_option_duration.hurl diff --git a/integration/hurl/tests_error_parser/invalid_option_duration.sh b/integration/hurl/tests_error_parser/invalid_option_duration.sh new file mode 100755 index 000000000..61bea157a --- /dev/null +++ b/integration/hurl/tests_error_parser/invalid_option_duration.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -Eeuo pipefail + +hurl tests_error_parser/invalid_option_duration.hurl diff --git a/integration/hurl/tests_failed/retry_option.err.pattern b/integration/hurl/tests_failed/retry_option.err.pattern index df03df100..4bc883340 100644 --- a/integration/hurl/tests_failed/retry_option.err.pattern +++ b/integration/hurl/tests_failed/retry_option.err.pattern @@ -3,7 +3,7 @@ * * Entry options: * retry: 2 -* retry-interval: 0 +* retry-interval: 0ms * * Cookie store: * diff --git a/integration/hurl/tests_failed/retry_option.hurl b/integration/hurl/tests_failed/retry_option.hurl index fb04f4e95..8cdcf625c 100644 --- a/integration/hurl/tests_failed/retry_option.hurl +++ b/integration/hurl/tests_failed/retry_option.hurl @@ -1,5 +1,5 @@ GET http://localhost:8000/not-found [Options] retry: 2 -retry-interval: 0 +retry-interval: 0ms HTTP 200 diff --git a/integration/hurl/tests_ok/delay.hurl b/integration/hurl/tests_ok/delay.hurl index bdd623d2b..fdacf9afb 100644 --- a/integration/hurl/tests_ok/delay.hurl +++ b/integration/hurl/tests_ok/delay.hurl @@ -18,7 +18,7 @@ HTTP 200 GET http://localhost:8000/delay-and-retry [Options] retry: 10 -retry-interval: 10 +retry-interval: 10ms HTTP 200 [Asserts] body toInt > 5 # Trigger a retry for 5 requests diff --git a/integration/hurl/tests_ok/delay_option.err.pattern b/integration/hurl/tests_ok/delay_option.err.pattern index a2988eaea..81820a095 100644 --- a/integration/hurl/tests_ok/delay_option.err.pattern +++ b/integration/hurl/tests_ok/delay_option.err.pattern @@ -29,7 +29,7 @@ * Executing entry 2 * * Entry options: -* delay: 1000 +* delay: 1000ms * * Delay entry 2 (pause 1000 ms) * diff --git a/integration/hurl/tests_ok/delay_option.hurl b/integration/hurl/tests_ok/delay_option.hurl index e1c550a1b..2a5919244 100644 --- a/integration/hurl/tests_ok/delay_option.hurl +++ b/integration/hurl/tests_ok/delay_option.hurl @@ -5,5 +5,5 @@ HTTP 200 # This request must reach the server at least 1000ms after the first request GET http://localhost:8000/delay [Options] -delay: 1000 +delay: 1000ms HTTP 200 diff --git a/integration/hurl/tests_ok/parallel.err.pattern b/integration/hurl/tests_ok/parallel.err.pattern index c07bfa6ce..51b3e032d 100644 --- a/integration/hurl/tests_ok/parallel.err.pattern +++ b/integration/hurl/tests_ok/parallel.err.pattern @@ -5,7 +5,7 @@ * Executing entry 1 * * Entry options: -* delay: 5000 +* delay: 5000ms * * Delay entry 1 (pause 5000 ms) * @@ -39,7 +39,7 @@ * Executing entry 1 * * Entry options: -* delay: 5000 +* delay: 5000ms * * Delay entry 1 (pause 5000 ms) * @@ -73,7 +73,7 @@ * Executing entry 1 * * Entry options: -* delay: 5000 +* delay: 5000ms * * Delay entry 1 (pause 5000 ms) * @@ -107,7 +107,7 @@ * Executing entry 1 * * Entry options: -* delay: 5000 +* delay: 5000ms * * Delay entry 1 (pause 5000 ms) * diff --git a/integration/hurl/tests_ok/parallel.hurl b/integration/hurl/tests_ok/parallel.hurl index b02074317..013c09e62 100644 --- a/integration/hurl/tests_ok/parallel.hurl +++ b/integration/hurl/tests_ok/parallel.hurl @@ -1,5 +1,5 @@ GET http://localhost:8000/parallel/hello?name={{name}} [Options] -delay: 5000 +delay: 5000ms HTTP 200 `Hello Bob from a parallel world!\n` diff --git a/integration/hurl/tests_ok/retry_option.err.pattern b/integration/hurl/tests_ok/retry_option.err.pattern index 5477437a2..ac69796c1 100644 --- a/integration/hurl/tests_ok/retry_option.err.pattern +++ b/integration/hurl/tests_ok/retry_option.err.pattern @@ -32,7 +32,7 @@ * * Entry options: * retry: 10 -* retry-interval: 100 +* retry-interval: 100ms * * Cookie store: * diff --git a/integration/hurl/tests_ok/retry_option.hurl b/integration/hurl/tests_ok/retry_option.hurl index a71217885..406de7742 100644 --- a/integration/hurl/tests_ok/retry_option.hurl +++ b/integration/hurl/tests_ok/retry_option.hurl @@ -11,7 +11,7 @@ jsonpath "$.state" == "RUNNING" GET http://localhost:8000/jobs/{{job_id}} [Options] retry: 10 -retry-interval: 100 +retry-interval: 100ms HTTP 200 [Asserts] jsonpath "$.state" == "COMPLETED" diff --git a/integration/hurlfmt/tests_export/options.html b/integration/hurlfmt/tests_export/options.html index 1267becd2..db6bd57e5 100644 --- a/integration/hurlfmt/tests_export/options.html +++ b/integration/hurlfmt/tests_export/options.html @@ -8,6 +8,8 @@ compressed: false connect-to: example.com:443:example.net:8443 delay: 1000 +delay: 1000ms +delay: 1s location: false location-trusted: false http1.0: false @@ -31,6 +33,8 @@ retry: -1 retry: 4 retry-interval: 1000 +retry-interval: 1000ms +retry-interval: 1s skip: false unix-socket: build/unix_socket.sock user: bob:secret diff --git a/integration/hurlfmt/tests_export/options.hurl b/integration/hurlfmt/tests_export/options.hurl index 0f2761d5a..fdda623db 100644 --- a/integration/hurlfmt/tests_export/options.hurl +++ b/integration/hurlfmt/tests_export/options.hurl @@ -8,6 +8,8 @@ key: keyfile compressed: false connect-to: example.com:443:example.net:8443 delay: 1000 +delay: 1000ms +delay: 1s location: false location-trusted: false http1.0: false @@ -31,6 +33,8 @@ retry: 0 retry: -1 retry: 4 retry-interval: 1000 +retry-interval: 1000ms +retry-interval: 1s skip: false unix-socket: build/unix_socket.sock user: bob:secret diff --git a/integration/hurlfmt/tests_export/options.json b/integration/hurlfmt/tests_export/options.json index a1fd99235..15aeb27cc 100644 --- a/integration/hurlfmt/tests_export/options.json +++ b/integration/hurlfmt/tests_export/options.json @@ -1 +1 @@ -{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/hello","options":[{"name":"aws-sigv4","value":"aws:amz:eu-central-1:sts"},{"name":"cacert","value":"cacertfile"},{"name":"cert","value":"certfile"},{"name":"cert","value":"certfile:qU114@q,[\"NO"},{"name":"key","value":"keyfile"},{"name":"compressed","value":false},{"name":"connect-to","value":"example.com:443:example.net:8443"},{"name":"delay","value":1000},{"name":"location","value":false},{"name":"location-trusted","value":false},{"name":"http1.0","value":false},{"name":"http1.1","value":false},{"name":"http2","value":false},{"name":"http3","value":false},{"name":"insecure","value":false},{"name":"ipv4","value":false},{"name":"ipv6","value":false},{"name":"max-redirs","value":10},{"name":"netrc","value":false},{"name":"netrc-file","value":"netrcfile"},{"name":"netrc-optional","value":false},{"name":"output","value":"output.txt"},{"name":"path-as-is","value":false},{"name":"proxy","value":"http://proxy.example"},{"name":"repeat","value":-1},{"name":"repeat","value":5},{"name":"resolve","value":"example.com:443:127.0.0.1"},{"name":"retry","value":0},{"name":"retry","value":-1},{"name":"retry","value":4},{"name":"retry-interval","value":1000},{"name":"skip","value":false},{"name":"unix-socket","value":"build/unix_socket.sock"},{"name":"user","value":"bob:secret"},{"name":"variable","value":"user=null"},{"name":"variable","value":"status=true"},{"name":"variable","value":"count=2"},{"name":"variable","value":"score=7.7"},{"name":"variable","value":"name=Bob"},{"name":"verbose","value":false},{"name":"very-verbose","value":false}]}},{"request":{"method":"GET","url":"http://localhost:8000/hello","options":[{"name":"aws-sigv4","value":"{{aws-sigv4}}"},{"name":"cacert","value":"{{cacert}}"},{"name":"cert","value":"{{cert}}"},{"name":"key","value":"{{key}}"},{"name":"compressed","value":"{{compressed}}"},{"name":"connect-to","value":"{{connect-to}}"},{"name":"delay","value":"{{delay}}"},{"name":"location","value":"{{location}}"},{"name":"location-trusted","value":"{{location-trusted}}"},{"name":"http1.0","value":"{{http10}}"},{"name":"http1.1","value":"{{http11}}"},{"name":"http2","value":"{{http2}}"},{"name":"http3","value":"{{http3}}"},{"name":"insecure","value":"{{insecure}}"},{"name":"ipv4","value":"{{ipv4}}"},{"name":"ipv6","value":"{{ipv6}}"},{"name":"max-redirs","value":"{{max-redirs}}"},{"name":"netrc","value":"{{netrc}}"},{"name":"netrc-file","value":"{{netrc-file}}"},{"name":"netrc-optional","value":"{{netrc-optional}}"},{"name":"output","value":"{{output}}"},{"name":"path-as-is","value":"{{path-as-is}}"},{"name":"proxy","value":"{{proxy}}"},{"name":"repeat","value":"{{repeat}}"},{"name":"resolve","value":"{{resolve}}"},{"name":"retry","value":"{{retry}}"},{"name":"retry-interval","value":"{{retry-interval}}"},{"name":"skip","value":"{{skip}}"},{"name":"unix-socket","value":"{{socket-file}}"},{"name":"user","value":"{{user}}"},{"name":"verbose","value":"{{verbose}}"},{"name":"very-verbose","value":"{{very-verbose}}"}]}}]} +{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/hello","options":[{"name":"aws-sigv4","value":"aws:amz:eu-central-1:sts"},{"name":"cacert","value":"cacertfile"},{"name":"cert","value":"certfile"},{"name":"cert","value":"certfile:qU114@q,[\"NO"},{"name":"key","value":"keyfile"},{"name":"compressed","value":false},{"name":"connect-to","value":"example.com:443:example.net:8443"},{"name":"delay","value":1000},{"value":1000,"unit":"ms","name":"delay"},{"value":1,"unit":"s","name":"delay"},{"name":"location","value":false},{"name":"location-trusted","value":false},{"name":"http1.0","value":false},{"name":"http1.1","value":false},{"name":"http2","value":false},{"name":"http3","value":false},{"name":"insecure","value":false},{"name":"ipv4","value":false},{"name":"ipv6","value":false},{"name":"max-redirs","value":10},{"name":"netrc","value":false},{"name":"netrc-file","value":"netrcfile"},{"name":"netrc-optional","value":false},{"name":"output","value":"output.txt"},{"name":"path-as-is","value":false},{"name":"proxy","value":"http://proxy.example"},{"name":"repeat","value":-1},{"name":"repeat","value":5},{"name":"resolve","value":"example.com:443:127.0.0.1"},{"name":"retry","value":0},{"name":"retry","value":-1},{"name":"retry","value":4},{"name":"retry-interval","value":1000},{"value":1000,"unit":"ms","name":"retry-interval"},{"value":1,"unit":"s","name":"retry-interval"},{"name":"skip","value":false},{"name":"unix-socket","value":"build/unix_socket.sock"},{"name":"user","value":"bob:secret"},{"name":"variable","value":"user=null"},{"name":"variable","value":"status=true"},{"name":"variable","value":"count=2"},{"name":"variable","value":"score=7.7"},{"name":"variable","value":"name=Bob"},{"name":"verbose","value":false},{"name":"very-verbose","value":false}]}},{"request":{"method":"GET","url":"http://localhost:8000/hello","options":[{"name":"aws-sigv4","value":"{{aws-sigv4}}"},{"name":"cacert","value":"{{cacert}}"},{"name":"cert","value":"{{cert}}"},{"name":"key","value":"{{key}}"},{"name":"compressed","value":"{{compressed}}"},{"name":"connect-to","value":"{{connect-to}}"},{"name":"delay","value":"{{delay}}"},{"name":"location","value":"{{location}}"},{"name":"location-trusted","value":"{{location-trusted}}"},{"name":"http1.0","value":"{{http10}}"},{"name":"http1.1","value":"{{http11}}"},{"name":"http2","value":"{{http2}}"},{"name":"http3","value":"{{http3}}"},{"name":"insecure","value":"{{insecure}}"},{"name":"ipv4","value":"{{ipv4}}"},{"name":"ipv6","value":"{{ipv6}}"},{"name":"max-redirs","value":"{{max-redirs}}"},{"name":"netrc","value":"{{netrc}}"},{"name":"netrc-file","value":"{{netrc-file}}"},{"name":"netrc-optional","value":"{{netrc-optional}}"},{"name":"output","value":"{{output}}"},{"name":"path-as-is","value":"{{path-as-is}}"},{"name":"proxy","value":"{{proxy}}"},{"name":"repeat","value":"{{repeat}}"},{"name":"resolve","value":"{{resolve}}"},{"name":"retry","value":"{{retry}}"},{"name":"retry-interval","value":"{{retry-interval}}"},{"name":"skip","value":"{{skip}}"},{"name":"unix-socket","value":"{{socket-file}}"},{"name":"user","value":"{{user}}"},{"name":"verbose","value":"{{verbose}}"},{"name":"very-verbose","value":"{{very-verbose}}"}]}}]} diff --git a/integration/hurlfmt/tests_export/options.lint.hurl b/integration/hurlfmt/tests_export/options.lint.hurl index 0f2761d5a..5c0cf36ec 100644 --- a/integration/hurlfmt/tests_export/options.lint.hurl +++ b/integration/hurlfmt/tests_export/options.lint.hurl @@ -7,7 +7,9 @@ cert: certfile:qU114@q,["NO key: keyfile compressed: false connect-to: example.com:443:example.net:8443 -delay: 1000 +delay: 1000ms +delay: 1000ms +delay: 1s location: false location-trusted: false http1.0: false @@ -30,7 +32,9 @@ resolve: example.com:443:127.0.0.1 retry: 0 retry: -1 retry: 4 -retry-interval: 1000 +retry-interval: 1000ms +retry-interval: 1000ms +retry-interval: 1s skip: false unix-socket: build/unix_socket.sock user: bob:secret