Run tests in parallel.

This commit is contained in:
Jean-Christophe Amiel 2024-04-30 13:58:30 +02:00
parent 860585afaa
commit 9638b9b2b4
No known key found for this signature in database
GPG Key ID: 07FF11CFD55356CC
9 changed files with 11 additions and 13 deletions

View File

@ -1,6 +1,4 @@
tests_ok/test.1.hurl: Running [1/2]
tests_ok/test.1.hurl: Success (1 request(s) in ~~~ ms)
tests_ok/test.2.hurl: Running [2/2]
error: Assert body value
--> tests_ok/test.2.hurl:8:1
|
@ -17,7 +15,6 @@ Succeeded files: 1 (50.0%)
Failed files: 1 (50.0%)
Duration: ~~~ ms
tests_ok/test.3.hurl: Running [1/1]
tests_ok/test.3.hurl: Success (1 request(s) in ~~~ ms)
--------------------------------------------------------------------------------
Executed files: 1

View File

@ -3,6 +3,7 @@ $ErrorActionPreference = 'Stop'
if (Test-Path build/result.xml) {
Remove-Item build/result.xml
}
hurl --test --report-junit build/result.xml tests_ok/test.1.hurl tests_ok/test.2.hurl
# We use --jobs 1 to force the standard error order to be test1 then test2.
hurl --test --jobs 1 --report-junit build/result.xml tests_ok/test.1.hurl tests_ok/test.2.hurl
hurl --test --report-junit build/result.xml tests_ok/test.3.hurl
Write-Host (Get-Content build/result.xml -Raw) -NoNewLine

View File

@ -4,7 +4,8 @@ rm -f build/result.xml
# test.2.hurl is KO but we want the script to continue until the end
set +eo pipefail
hurl --test --report-junit build/result.xml tests_ok/test.1.hurl tests_ok/test.2.hurl
# We use --jobs 1 to force the standard error order to be test1 then test2.
hurl --test --jobs 1 --report-junit build/result.xml tests_ok/test.1.hurl tests_ok/test.2.hurl
hurl --test --report-junit build/result.xml tests_ok/test.3.hurl
set -Eeuo pipefail

View File

@ -1,7 +1,7 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl --test --json --parallel --jobs 1 `
hurl --test --json --jobs 1 `
tests_ok/parallel_a.hurl `
tests_ok/parallel_b.hurl `
tests_ok/parallel_c.hurl `

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -Eeuo pipefail
hurl --test --json --parallel --jobs 1 \
hurl --test --json --jobs 1 \
tests_ok/parallel_a.hurl \
tests_ok/parallel_b.hurl \
tests_ok/parallel_c.hurl \

View File

@ -1,6 +1,4 @@
tests_ok~test.1.hurl: Running [1/3]
tests_ok~test.1.hurl: Success (1 request(s) in ~~~ ms)
tests_ok~test.2.hurl: Running [2/3]
error: Assert body value
--> tests_ok~test.2.hurl:8:1
|
@ -11,7 +9,6 @@ error: Assert body value
|
tests_ok~test.2.hurl: Failure (2 request(s) in ~~~ ms)
tests_ok~test.3.hurl: Running [3/3]
tests_ok~test.3.hurl: Success (1 request(s) in ~~~ ms)
--------------------------------------------------------------------------------
Executed files: 3

View File

@ -1,3 +1,4 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl --test --glob "tests_ok/test.*.hurl"
# We're using --jobs 1 to fix the standard error order.
hurl --test --jobs 1 --glob "tests_ok/test.*.hurl"

View File

@ -1,3 +1,4 @@
#!/bin/bash
set -Eeuo pipefail
hurl --test --glob "tests_ok/test.*.hurl"
# We're using --jobs 1 to fix the standard error order.
hurl --test --jobs 1 --glob "tests_ok/test.*.hurl"

View File

@ -295,7 +295,7 @@ pub fn output_type(arg_matches: &ArgMatches) -> OutputType {
}
pub fn parallel(arg_matches: &ArgMatches) -> bool {
has_flag(arg_matches, "parallel")
has_flag(arg_matches, "parallel") || has_flag(arg_matches, "test")
}
pub fn path_as_is(arg_matches: &ArgMatches) -> bool {