Fix integration tests file.

This commit is contained in:
Jean-Christophe Amiel 2025-05-29 15:46:34 +02:00
parent 154dfa0cc5
commit e1f9919bc7
No known key found for this signature in database
GPG Key ID: 07FF11CFD55356CC
8 changed files with 19 additions and 13 deletions

View File

@ -119,7 +119,7 @@ while read -r script_sh ; do
echo
errors_count=$((errors_count+1))
fi
done < <(find ./integration/hurl*/*/ -maxdepth 1 -type f -name "*sh" | sort)
done < <(find ./integration/hurl*/*/ -maxdepth 2 -type f -name "*sh" | sort)
unset -f filter_hurl_and_hurlfmt clean_indent uncomment clean_sh_var_redirect clean_ps1_var_redirect clean_c_drive conv_ps1_antislash_to_sh conv_ps1_null_to_sh
# Control errors count

View File

@ -1,7 +1,7 @@
#!/bin/bash
#!/bin/bash
set -Eeuo pipefail
for hurl_file in integration/hurl/{tests_failed,tests_ok}/*.hurl; do
for hurl_file in integration/hurl/{tests_failed,tests_ok/**}/*.hurl; do
echo "hurlfmt $hurl_file"
output_file=/tmp/$(basename "$hurl_file")
hurlfmt "$hurl_file" >"$output_file"

View File

@ -6,7 +6,7 @@ color_yellow=$(echo -ne "\033[1;33m")
color_green=$(echo -ne "\033[1;32m")
color_reset=$(echo -e "\033[0m")
cmd_find_test_files="find ./tests_ok ./tests_failed -maxdepth 1 -type f -name '*.curl' ! -name '*windows*'"
cmd_find_test_files="find ./tests_ok ./tests_failed -maxdepth 2 -type f -name '*.curl' ! -name '*windows*'"
exclude_lines="^#"
echo -e "\n# curl infos"
which curl

View File

@ -12,4 +12,4 @@ bytes contains hex,02;
sha256 == hex,039058c6f2c0cb492c533b0a4d14ef77cc0f78abccced5287d84a1a2011cfb81;
sha256 toHex == "039058c6f2c0cb492c533b0a4d14ef77cc0f78abccced5287d84a1a2011cfb81"
md5 == hex,5289df737df57326fcdd22597afb1fac;
md5 toHex == "5289df737df57326fcdd22597afb1fac"
md5 toHex == "5289df737df57326fcdd22597afb1fac"

View File

@ -1,8 +1,14 @@
curl --header 'Accept: text/plain' 'http://localhost:8000/follow-redirect'
curl --header 'Accept: text/plain' 'http://localhost:8000/follow-redirect'
curl --header 'Accept: text/plain' --location 'http://localhost:8000/follow-redirect'
curl --data '' --header 'Accept: text/plain' --location 'http://localhost:8000/follow-redirect'
curl --data '' --header 'Accept: text/plain' --location 'http://localhost:8000/follow-redirect-308'
curl --header 'Accept: text/plain' --header 'Content-Type:' --data 'Hello world!' --location 'http://localhost:8000/follow-redirect-from-post'
curl --header 'Accept: text/plain' --header 'Content-Type:' --data 'Hello world!' --location 'http://localhost:8000/follow-redirect-308'
curl --header 'Accept: text/plain' --location 'http://localhost:8000/follow-redirect/relative/foo'
curl --header 'Authorization: Basic Ym9iQGVtYWlsLmNvbTpzZWNyZXQ=' --location 'http://localhost:8000/follow-redirect-basic-auth'
curl --header 'Authorization: Basic Ym9iQGVtYWlsLmNvbTpzZWNyZXQ=' --location-trusted 'http://localhost:8000/follow-redirect-basic-auth-trusted'
curl --header 'Authorization: Basic Ym9iQGVtYWlsLmNvbTpzZWNyZXQ=' --location 'http://localhost:8000/follow-redirect-basic-auth?change_host=true'
curl --header 'authorization: Basic Ym9iQGVtYWlsLmNvbTpzZWNyZXQ=' --location 'http://localhost:8000/follow-redirect-basic-auth?change_host=true'
curl --header 'Authorization: Basic Ym9iQGVtYWlsLmNvbTpzZWNyZXQ=' --location 'http://localhost:8000/follow-redirect-basic-auth?change_host=false'
curl --location --user 'bob@email.com:secret' 'http://localhost:8000/follow-redirect-basic-auth?change_host=true'
curl --location --user 'bob@email.com:secret' 'http://localhost:8000/follow-redirect-basic-auth?change_host=false'
curl --header 'Authorization: Basic Ym9iQGVtYWlsLmNvbTpzZWNyZXQ=' --location 'http://localhost:8000/follow-redirect-basic-auth?change_host=true'
curl --header 'Authorization: Basic Ym9iQGVtYWlsLmNvbTpzZWNyZXQ=' --location 'http://localhost:8000/follow-redirect-basic-auth?change_host=false'
curl --header 'Authorization: Basic Ym9iQGVtYWlsLmNvbTpzZWNyZXQ=' --location-trusted 'http://localhost:8000/follow-redirect-basic-auth-trusted'

View File

@ -1,2 +1,2 @@
curl --header 'Content-Type:' --data-binary '@tests_ok/data.bin' 'http://localhost:8000/post-file'
curl --header 'Content-Type:' --data-binary '@tests_ok/post_file_with space' 'http://localhost:8000/post-file'
curl --header 'Content-Type:' --data-binary '@tests_ok/post/data.bin' 'http://localhost:8000/post-file'
curl --header 'Content-Type:' --data-binary '@tests_ok/post/post_file_with space' 'http://localhost:8000/post-file'

View File

@ -1,4 +1,4 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl --variable filename=data.bin --verbose tests_ok/post/post_file.hurl
hurl --variable filename=data.bin tests_ok/post/post_file.hurl

View File

@ -10,7 +10,7 @@ import test_script
def get_files(glob_expr):
return sorted([f.replace("\\", "/") for f in glob.glob(glob_expr)])
return sorted([f.replace("\\", "/") for f in glob.glob(glob_expr, recursive=True)])
def accept(f: str) -> bool:
@ -25,7 +25,7 @@ def main():
[test_format.test("html", f) for f in hurl_files]
extension = "ps1" if platform.system() == "Windows" else "sh"
script_files = get_files("tests_ok/*." + extension) + get_files(
script_files = get_files("tests_ok/**/*." + extension) + get_files(
"tests_failed/*." + extension
)
for f in sorted(script_files):