From 2feb8d78dff7b3463258a1839bad17de1a619d80 Mon Sep 17 00:00:00 2001 From: jcamiel Date: Tue, 16 Apr 2024 13:58:20 +0200 Subject: [PATCH] Expose experimental --parallel / --jobs options. --- README.md | 2 ++ docs/manual.md | 2 ++ docs/manual/hurl.1 | 21 ++++++++++++++++++++- docs/manual/hurl.md | 19 +++++++++++++++++++ docs/manual/hurlfmt.1 | 2 +- docs/spec/options/hurl/jobs.option | 1 - docs/spec/options/hurl/parallel.option | 1 - integration/hurl/tests_ok/help.out.pattern | 4 ++++ packages/hurl/README.md | 2 ++ packages/hurl/src/cli/options/commands.rs | 2 -- 10 files changed, 50 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 033162dde..ed36dac62 100644 --- a/README.md +++ b/README.md @@ -1198,6 +1198,7 @@ will follow a redirection only for the second entry. | --interactive | Stop between requests.

This is similar to a break point, You can then continue (Press C) or quit (Press Q).

This is a cli-only option.
| | -4, --ipv4 | This option tells Hurl to use IPv4 addresses only when resolving host names, and not for example try IPv6.
| | -6, --ipv6 | This option tells Hurl to use IPv6 addresses only when resolving host names, and not for example try IPv4.
| +| --jobs <NUM> | (Experimental) Maximum number of parallel jobs in parallel mode. Default value corresponds (in most cases) to the
current amount of CPUs.

See also [`--parallel`](#parallel).

This is a cli-only option.
| | --json | Output each Hurl file result to JSON. The format is very closed to HAR format.

This is a cli-only option.
| | --key <KEY> | Private key file name.
| | -L, --location | Follow redirect. To limit the amount of redirects to follow use the [`--max-redirs`](#max-redirs) option
| @@ -1212,6 +1213,7 @@ will follow a redirection only for the second entry. | --no-output | Suppress output. By default, Hurl outputs the body of the last response.

This is a cli-only option.
| | --noproxy <HOST(S)> | Comma-separated list of hosts which do not use a proxy.

Override value from Environment variable no_proxy.
| | -o, --output <FILE> | Write output to FILE instead of stdout.
| +| --parallel | (Experimental) Run files in parallel.

Each Hurl file is executed in its own worker thread, without sharing anything with the other workers. The default run mode is sequential.

See also [`--max-workers`](#max-workers).

This is a cli-only option.
| | --path-as-is | Tell Hurl to not handle sequences of /../ or /./ in the given URL path. Normally Hurl will squash or merge them according to standards but with this option set you tell it not to do that.
| | -x, --proxy <[PROTOCOL://]HOST[:PORT]> | Use the specified proxy.
| | --report-html <DIR> | Generate HTML report in DIR.

If the HTML report already exists, it will be updated with the new test results.

This is a cli-only option.
| diff --git a/docs/manual.md b/docs/manual.md index e145a525d..7cd4520ca 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -173,6 +173,7 @@ will follow a redirection only for the second entry. | --interactive | Stop between requests.

This is similar to a break point, You can then continue (Press C) or quit (Press Q).

This is a cli-only option.
| | -4, --ipv4 | This option tells Hurl to use IPv4 addresses only when resolving host names, and not for example try IPv6.
| | -6, --ipv6 | This option tells Hurl to use IPv6 addresses only when resolving host names, and not for example try IPv4.
| +| --jobs <NUM> | (Experimental) Maximum number of parallel jobs in parallel mode. Default value corresponds (in most cases) to the
current amount of CPUs.

See also [`--parallel`](#parallel).

This is a cli-only option.
| | --json | Output each Hurl file result to JSON. The format is very closed to HAR format.

This is a cli-only option.
| | --key <KEY> | Private key file name.
| | -L, --location | Follow redirect. To limit the amount of redirects to follow use the [`--max-redirs`](#max-redirs) option
| @@ -187,6 +188,7 @@ will follow a redirection only for the second entry. | --no-output | Suppress output. By default, Hurl outputs the body of the last response.

This is a cli-only option.
| | --noproxy <HOST(S)> | Comma-separated list of hosts which do not use a proxy.

Override value from Environment variable no_proxy.
| | -o, --output <FILE> | Write output to FILE instead of stdout.
| +| --parallel | (Experimental) Run files in parallel.

Each Hurl file is executed in its own worker thread, without sharing anything with the other workers. The default run mode is sequential.

See also [`--max-workers`](#max-workers).

This is a cli-only option.
| | --path-as-is | Tell Hurl to not handle sequences of /../ or /./ in the given URL path. Normally Hurl will squash or merge them according to standards but with this option set you tell it not to do that.
| | -x, --proxy <[PROTOCOL://]HOST[:PORT]> | Use the specified proxy.
| | --report-html <DIR> | Generate HTML report in DIR.

If the HTML report already exists, it will be updated with the new test results.

This is a cli-only option.
| diff --git a/docs/manual/hurl.1 b/docs/manual/hurl.1 index fa249dc50..406cdac2b 100644 --- a/docs/manual/hurl.1 +++ b/docs/manual/hurl.1 @@ -1,4 +1,4 @@ -.TH hurl 1 "15 Apr 2024" "hurl 4.3.0-SNAPSHOT" " Hurl Manual" +.TH hurl 1 "16 Apr 2024" "hurl 4.3.0-SNAPSHOT" " Hurl Manual" .SH NAME hurl - run and test HTTP requests. @@ -276,6 +276,15 @@ This option tells Hurl to use IPv4 addresses only when resolving host names, and This option tells Hurl to use IPv6 addresses only when resolving host names, and not for example try IPv4. +.IP "--jobs " + +(Experimental) Maximum number of parallel jobs in parallel mode. Default value corresponds (in most cases) to the +current amount of CPUs. + +See also \fI--parallel\fP. + +This is a cli-only option. + .IP "--json " Output each Hurl file result to JSON. The format is very closed to HAR format. @@ -355,6 +364,16 @@ Override value from Environment variable no_proxy. Write output to FILE instead of stdout. +.IP "--parallel " + +(Experimental) Run files in parallel. + +Each Hurl file is executed in its own worker thread, without sharing anything with the other workers. The default run mode is sequential. + +See also \fI--max-workers\fP. + +This is a cli-only option. + .IP "--path-as-is " Tell Hurl to not handle sequences of /../ or /./ in the given URL path. Normally Hurl will squash or merge them according to standards but with this option set you tell it not to do that. diff --git a/docs/manual/hurl.md b/docs/manual/hurl.md index 8eba439fd..ed7c67ced 100644 --- a/docs/manual/hurl.md +++ b/docs/manual/hurl.md @@ -295,6 +295,15 @@ This option tells Hurl to use IPv4 addresses only when resolving host names, and This option tells Hurl to use IPv6 addresses only when resolving host names, and not for example try IPv4. +### --jobs {#jobs} + +(Experimental) Maximum number of parallel jobs in parallel mode. Default value corresponds (in most cases) to the +current amount of CPUs. + +See also [`--parallel`](#parallel). + +This is a cli-only option. + ### --json {#json} Output each Hurl file result to JSON. The format is very closed to HAR format. @@ -374,6 +383,16 @@ Override value from Environment variable no_proxy. Write output to FILE instead of stdout. +### --parallel {#parallel} + +(Experimental) Run files in parallel. + +Each Hurl file is executed in its own worker thread, without sharing anything with the other workers. The default run mode is sequential. + +See also [`--max-workers`](#max-workers). + +This is a cli-only option. + ### --path-as-is {#path-as-is} Tell Hurl to not handle sequences of /../ or /./ in the given URL path. Normally Hurl will squash or merge them according to standards but with this option set you tell it not to do that. diff --git a/docs/manual/hurlfmt.1 b/docs/manual/hurlfmt.1 index 766d1e92b..69167fb97 100644 --- a/docs/manual/hurlfmt.1 +++ b/docs/manual/hurlfmt.1 @@ -1,4 +1,4 @@ -.TH hurl 1 "15 Apr 2024" "hurl 4.3.0-SNAPSHOT" " Hurl Manual" +.TH hurl 1 "16 Apr 2024" "hurl 4.3.0-SNAPSHOT" " Hurl Manual" .SH NAME hurlfmt - format Hurl files diff --git a/docs/spec/options/hurl/jobs.option b/docs/spec/options/hurl/jobs.option index c14e1e9f8..17ad23d74 100644 --- a/docs/spec/options/hurl/jobs.option +++ b/docs/spec/options/hurl/jobs.option @@ -4,7 +4,6 @@ value: NUM value_parser: clap::value_parser!(u32).range(1..) help: (Experimental) Maximum number of parallel jobs cli_only: true -experimental: true --- (Experimental) Maximum number of parallel jobs in parallel mode. Default value corresponds (in most cases) to the current amount of CPUs. diff --git a/docs/spec/options/hurl/parallel.option b/docs/spec/options/hurl/parallel.option index 22b7ba184..38eaaf9c4 100644 --- a/docs/spec/options/hurl/parallel.option +++ b/docs/spec/options/hurl/parallel.option @@ -2,7 +2,6 @@ name: parallel long: parallel help: (Experimental) Run files in parallel cli_only: true -experimental: true --- (Experimental) Run files in parallel. diff --git a/integration/hurl/tests_ok/help.out.pattern b/integration/hurl/tests_ok/help.out.pattern index 62d2096fa..4a6e77069 100644 --- a/integration/hurl/tests_ok/help.out.pattern +++ b/integration/hurl/tests_ok/help.out.pattern @@ -65,6 +65,8 @@ Options: -6, --ipv6 Tell Hurl to use IPv6 addresses only when resolving host names, and not for example try IPv4 + --jobs + (Experimental) Maximum number of parallel jobs --json Output each Hurl file result to JSON --max-filesize @@ -87,6 +89,8 @@ Options: List of hosts which do not use proxy -o, --output Write to FILE instead of stdout + --parallel + (Experimental) Run files in parallel --path-as-is Tell Hurl to not handle sequences of /../ or /./ in the given URL path -x, --proxy <[PROTOCOL://]HOST[:PORT]> diff --git a/packages/hurl/README.md b/packages/hurl/README.md index d501646e4..160c93205 100644 --- a/packages/hurl/README.md +++ b/packages/hurl/README.md @@ -1190,6 +1190,7 @@ will follow a redirection only for the second entry. | --interactive | Stop between requests.

This is similar to a break point, You can then continue (Press C) or quit (Press Q).

This is a cli-only option.
| | -4, --ipv4 | This option tells Hurl to use IPv4 addresses only when resolving host names, and not for example try IPv6.
| | -6, --ipv6 | This option tells Hurl to use IPv6 addresses only when resolving host names, and not for example try IPv4.
| +| --jobs <NUM> | (Experimental) Maximum number of parallel jobs in parallel mode. Default value corresponds (in most cases) to the
current amount of CPUs.

See also [`--parallel`](#parallel).

This is a cli-only option.
| | --json | Output each Hurl file result to JSON. The format is very closed to HAR format.

This is a cli-only option.
| | --key <KEY> | Private key file name.
| | -L, --location | Follow redirect. To limit the amount of redirects to follow use the [`--max-redirs`](#max-redirs) option
| @@ -1204,6 +1205,7 @@ will follow a redirection only for the second entry. | --no-output | Suppress output. By default, Hurl outputs the body of the last response.

This is a cli-only option.
| | --noproxy <HOST(S)> | Comma-separated list of hosts which do not use a proxy.

Override value from Environment variable no_proxy.
| | -o, --output <FILE> | Write output to FILE instead of stdout.
| +| --parallel | (Experimental) Run files in parallel.

Each Hurl file is executed in its own worker thread, without sharing anything with the other workers. The default run mode is sequential.

See also [`--max-workers`](#max-workers).

This is a cli-only option.
| | --path-as-is | Tell Hurl to not handle sequences of /../ or /./ in the given URL path. Normally Hurl will squash or merge them according to standards but with this option set you tell it not to do that.
| | -x, --proxy <[PROTOCOL://]HOST[:PORT]> | Use the specified proxy.
| | --report-html <DIR> | Generate HTML report in DIR.

If the HTML report already exists, it will be updated with the new test results.

This is a cli-only option.
| diff --git a/packages/hurl/src/cli/options/commands.rs b/packages/hurl/src/cli/options/commands.rs index 7bdd17070..221d0b08e 100644 --- a/packages/hurl/src/cli/options/commands.rs +++ b/packages/hurl/src/cli/options/commands.rs @@ -271,7 +271,6 @@ pub fn jobs() -> clap::Arg { .value_parser(clap::value_parser!(u32).range(1..)) .help("(Experimental) Maximum number of parallel jobs") .num_args(1) - .hide(true) } pub fn json() -> clap::Arg { @@ -378,7 +377,6 @@ pub fn parallel() -> clap::Arg { .long("parallel") .help("(Experimental) Run files in parallel") .action(clap::ArgAction::SetTrue) - .hide(true) } pub fn path_as_is() -> clap::Arg {