mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-11-23 00:44:55 +03:00
Fix output in parallel mode.
This commit is contained in:
parent
2227b91ee1
commit
cd431d023a
0
integration/hurl/tests_ok/parallel_output_null.out
Executable file
0
integration/hurl/tests_ok/parallel_output_null.out
Executable file
11
integration/hurl/tests_ok/parallel_output_null.ps1
Normal file
11
integration/hurl/tests_ok/parallel_output_null.ps1
Normal file
@ -0,0 +1,11 @@
|
||||
Set-StrictMode -Version latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
hurl --parallel --output NUL `
|
||||
tests_ok/parallel_a.hurl `
|
||||
tests_ok/parallel_b.hurl `
|
||||
tests_ok/parallel_c.hurl `
|
||||
tests_ok/parallel_d.hurl `
|
||||
tests_ok/parallel_e.hurl `
|
||||
tests_ok/parallel_f.hurl `
|
||||
tests_ok/parallel_g.hurl
|
11
integration/hurl/tests_ok/parallel_output_null.sh
Executable file
11
integration/hurl/tests_ok/parallel_output_null.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
hurl --parallel --output /dev/null \
|
||||
tests_ok/parallel_a.hurl \
|
||||
tests_ok/parallel_b.hurl \
|
||||
tests_ok/parallel_c.hurl \
|
||||
tests_ok/parallel_d.hurl \
|
||||
tests_ok/parallel_e.hurl \
|
||||
tests_ok/parallel_f.hurl \
|
||||
tests_ok/parallel_g.hurl
|
@ -399,37 +399,7 @@ impl CliOptions {
|
||||
let netrc_file = self.netrc_file.clone();
|
||||
let netrc_optional = self.netrc_optional;
|
||||
let no_proxy = self.no_proxy.clone();
|
||||
// FIXME:
|
||||
// When used globally (on the command line), `--output` writes the last successful request
|
||||
// to `output` file. We don't want to output every entry's response, so we initialise
|
||||
// output to `None`.
|
||||
// The straightforward code should have been `let output = self.output;` but if we do this
|
||||
// every entry's response would have been dumped to stdout.
|
||||
//
|
||||
// If we compare with `--compressed`:
|
||||
//
|
||||
// ```
|
||||
// cli.compressed = true =>
|
||||
// entry_1.compressed = true
|
||||
// entry_2.compressed = true
|
||||
// entry_2.overridden.compressed = false
|
||||
// entry_3.compressed = true
|
||||
// etc...
|
||||
// entry_last.compressed = true
|
||||
// ```
|
||||
//
|
||||
// whereas
|
||||
//
|
||||
// ```
|
||||
// cli.output = /tmp/out.bin =>
|
||||
// entry_1.output = None
|
||||
// entry_2.output = None
|
||||
// entry_2.overridden.output = /tmp/bar.bin
|
||||
// entry_3.output = None
|
||||
// etc...
|
||||
// entry_last.output = /tmp/out.bin
|
||||
// ```
|
||||
let output = None;
|
||||
let output = self.output.clone();
|
||||
let path_as_is = self.path_as_is;
|
||||
let post_entry = if self.interactive {
|
||||
Some(cli::interactive::post_entry as fn() -> bool)
|
||||
|
@ -37,7 +37,14 @@ pub fn get_entry_options(
|
||||
variables: &mut HashMap<String, Value>,
|
||||
logger: &mut Logger,
|
||||
) -> Result<RunnerOptions, Error> {
|
||||
let mut runner_options = runner_options.clone();
|
||||
let runner_options = runner_options.clone();
|
||||
// When used globally (on the command line), `--output` writes the last successful request
|
||||
// to `output` file. We don't want to output every entry's response, so we initialise
|
||||
// output to `None`.
|
||||
let mut runner_options = RunnerOptions {
|
||||
output: None,
|
||||
..runner_options
|
||||
};
|
||||
if !has_options(entry) {
|
||||
return Ok(runner_options);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user