Skip to content

allowEmptyResults but error on missing file #689

@pboushy

Description

@pboushy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions