-
Notifications
You must be signed in to change notification settings - Fork 522
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
Use --json parameter to write JSON to stdout #283
Comments
Indeed, it might be good to be able to select a JSON output (instead of the default body).
What data do you need for your CI? |
The actual content of the
|
ok, we are going to think about it. Relating to the asserts in JSON, we haven't used it yet in practise. For sure, that needs to be updated. We will improve it for the next release. |
No problem, take your time. For now I will use the json file on disk to generate the test result summary. |
Relating to asserts in JSON output/report We would like to have the same data that we produce in the terminal. The question is more about the format: what do you think @tbolon ? example with the status query Terminal Output:
json#1
or
example with xpath Terminal output:
json#1
or
|
My goal is to populate a test report such as the one exposed by azure devops, see this example and this detail of one failed test, or this detail with an actual and expected value The "error message" pane displays the text returned by the failed test as-is, respecting new-line, so is seems the raw output could be enough. The only gain of having the structured actual/expected value could if we want to create a custom test failure message to highlight the expected/actual values. So, to conclude, I am not sure the structured actual/expected properties is really useful. My main grief was that the default raw output was emitting the entire response body, and I was expecting the json output to give me a more concise result that I could parse and return as a test failure message, which could be useful for the person reading the test result. |
ok thanks for your explanations. We will trunk the actual value to a maximum size (both in the terminal ouput and json). |
Asserts have been added in JSON in #301. We will keep this issue open until we find something satisfactory for the JSON output usage. |
As described in #330 , |
As described in #330 , --json will: outputs to stdout (instead of a file) |
I am planning to use hurl for integration testing and I want to parse the hurl output to generate CI/CD test results.
I have developed a custom program which is responsible for running hurl for multiple files and generate a test result compatible with our CI/CD infrastructure (azure devops).
As my custom program can read the standard output from hurl, and because the json format is perfect to read the results, I expected I could read the json directly from the program output.
But is seems the json result must be written in a file.
Perhaps if the
file
argument is omitted when adding the--json
option, the result could be simply written to the output ?PS: I know that the json option already append result to files (in case when you want to run hurl multiple times), but I find the standard output parsing easier (because it will not pollute the output directory with a result file).
PS2: Maybe this behavior could also be applied to the
--html
option ?The text was updated successfully, but these errors were encountered: