Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summary and body response output are interleaved when Hurl run multiple files #328

Closed
jcamiel opened this issue Oct 25, 2021 · 3 comments
Closed

Comments

@jcamiel
Copy link
Collaborator

jcamiel commented Oct 25, 2021

Running this command with Hurl 1.4.0 on macOS:

$ hurl hello.hurl assert_json.hurl
Hello World![
  { "id": 1, "name": "Bob"},
  { "id": 2, "name": "Bill"}
]

If we add --summary option:

Hello World![
  { "id": 1, "name": "Bob"},
  { "id": 2, "name": "Bill"}
--------------------------------------------------------------------------------
Executed:  2
Succeeded: 2 (100.0%)
Failed:    0 (0.0%)
Duration:  134ms
]

The last body response and summary seem to be interleaved.

@jcamiel jcamiel added the bug Something isn't working label Oct 25, 2021
@fabricereix
Copy link
Collaborator

They are not really interleaved, at least not in the same stream.
The body response is written to stdout while the summary is written to stderr.

$ hurl hello.hurl assert_json.hurl --summary >/dev/null
--------------------------------------------------------------------------------
Executed:  2
Succeeded: 2 (100.0%)
Failed:    0 (0.0%)
Duration:  64ms
$ hurl hello.hurl assert_json.hurl --summary 2>/dev/null
Hello World![
  { "id": 1, "name": "Bob"},
  { "id": 2, "name": "Bill"}
]

The summary should probably be another type of output.
meaning, it is written to stdout and instead of the body response,

We could have something like below

$ hurl hello.hurl assert_json.hurl --summary
Executed:  2
Succeeded: 2 (100.0%)
Failed:    0 (0.0%)
Duration:  64ms

or maybe with an option more explicit

$ hurl hello.hurl assert_json.hurl --output-type summary
Executed:  2
Succeeded: 2 (100.0%)
Failed:    0 (0.0%)
Duration:  64ms

@jcamiel
Copy link
Collaborator Author

jcamiel commented Oct 27, 2021

Ha, I didn't think about stdout/sdterr !

Without any modification, we could improve the actual output with "flushing" the stdout before writing the summary to stderr ? (don't know if it will change something)

@fabricereix fabricereix removed the bug Something isn't working label Nov 11, 2021
@fabricereix
Copy link
Collaborator

Summary is now a type of output (#351) and can not be used at the same time than the body response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants