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

Don't write everything to stderr which breaks CI pipelines and scripts #3616

Open
loxal opened this issue Jan 20, 2025 · 3 comments
Open

Don't write everything to stderr which breaks CI pipelines and scripts #3616

loxal opened this issue Jan 20, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@loxal
Copy link

loxal commented Jan 20, 2025

Image

On the console the tests are completed successfully and I get a nice concise output as you see above. For whatever reason you are writing this output to stderr instead of stdout as you can validate here, see below:

Image

This breaks the CI pipelines and makes your tool a burden in every CI pipeline and in scripting.

Image
@loxal loxal added the bug Something isn't working label Jan 20, 2025
@jcamiel
Copy link
Collaborator

jcamiel commented Jan 20, 2025

Hi @loxal

makes your tool a burden in every CI pipeline and in scripting.

If this is a burden, I've hard time understanding why you're using it. There are plenty of alternatives, consider this tool as a free tool given freely to the community so there is no need to be harsh.

That's said, Hurl is an HTTP client, one of the primary goal of the tool is to give you a HTTP response on standard output.

For instance, you can test this file:

GET https://foo.bin
HTTP 200

GET https://bar.bin
[Options]
output: -
HTTP 200

And get the response of https://bar.bin on standard output.

We've followed these guidelines:

  • standard output : returned HTTP response
  • standard error: error messages, progress, summary
  • exit code: 0 if success, != 0 failure.

Standard output and error can use ANSI escape code (colored text) but usually color is disabled if standard stream are piped (you can use --color / --no-color). I don't explain why the Hurl messages are in red in your CI logs, maybe you've an explanation.

So, on CI, you can use Hurl exit code to know if the tests have succeeded or not. You can use HTML/JUnit/JSON/TAP reports (sometimes CI have facilities to display these kind or reports) for reporting also.

@loxal
Copy link
Author

loxal commented Jan 20, 2025

This was just a specific proposal to make it easier for your tool to be adopted. I am using and have to use many tools that are much more of a burden than HURL but I won't bother to report issues for those tools. With HURL I had the hope that this would be received as a constructive specific feedback.

I am not talking about the exit code here but that all output goes to stderr which reserved for errors as the name implies and not for --verbose or regular output. I've fixed TeamCity CI via formatStderrAsError = false but this makes my test pipeline tolerant towards errors from tools that report only errors to stderr.

After formatStderrAsError = false the errors are turned into warnings and the CI pipeline succeeds:

Image

...but that's a bad workaround, probably worse than using unsafe {} where it's not necessary.

The tool is great in many other aspects and that's why I am using it. 👍

@jcamiel
Copy link
Collaborator

jcamiel commented Jan 20, 2025

Ok noted we'll see what we can do to improve your use case with TeamCity CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants