spectral
spectral copied to clipboard
JUnit format should include all passed tests in order to have an accurate failure rate
In Azure Pipelines, it makes much more sense to have test results with all passed tests along with the failed ones. We want to publish results even when they pass. And we want to know what percentage of tests failed. Right now if no tests failed, we get an empty xml file:
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
</testsuites>
And when they fail, it includes only the failed ones, so the failure rate is always either 100% or no results to publish.
I'd also like to request warnings added to JUnit output.
I'd also like to request warnings added to JUnit output.
This is possible by defining the fail-severity
option of the command line. It seems it is set to error
when the format is defined. Setting it to warn
will do the work for your case. In your case the command line will look like this:
spectral lint <path_to_api_file> --format junit --output spectral-report.xml --fail-severity warn
I'd also like to request warnings added to JUnit output.
This is possible by defining the
fail-severity
option of the command line. It seems it is set toerror
when the format is defined. Setting it towarn
will do the work for your case. In your case the command line will look like this:spectral lint <path_to_api_file> --format junit --output spectral-report.xml --fail-severity warn
That is true, but this just adds the warnings as <failure>
. Everything below error
should be added as <testcase>
(see JUnit XML format).