jenkinsci / jenkinsci/junit-plugin
allowEmptyResults but error on missing file
- Dominant language
- Java
- Stars
- 87
- Forks
- 351
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 2
Description
### What feature do you want to see added?
Currently the `allowEmptyResults: true` flag reports success when there are 0 tests in the junit file, or the junit file is missing.
We would like to be able to distinguish between when there are 0 tests in the junit file and when the junit file is missing.
This is important for tools like Trivy which generate test cases when they detect a vulnerability, but do not generate tests when no vulnerabilities are detected.
We want to distinguish between a junit file with 0 test cases and a missing junit file because this allows us to distinguish trivy running and finding 0 vulnerabilities and trivy failing and not generating a junit file.
We suggest adding a `disallowFileNotFound` flag which works in tandem with the `allowEmptyResults` flag to throw an error if the file is not found.
The documentation to generate a JUnit in Trivy is published here:
https://trivy.dev/v0.61/docs/configuration/reporting/#junit
The Jinja2 template used to generate the JUnit file is here:
https://github.com/aquasecurity/trivy/blob/main/contrib/junit.tpl
### Upstream changes
_No response_
### Are you interested in contributing this feature?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.