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

⭐️ junit support as reporter #302

Merged
merged 1 commit into from
Jan 23, 2023
Merged

⭐️ junit support as reporter #302

merged 1 commit into from
Jan 23, 2023

Conversation

chris-rock
Copy link
Member

Problem

I want to see my scan results in Jenkins

Solution

cnspec outputs the results as junit format now. To get the junit output, set the output format to junit and pipe the results to a file:

cnspec scan docker debian:10 --output junit > report.junit

The result looks like the following then:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
        <testsuite name="Policy Report for debian:10@edcf96f9d9d9" tests="85" failures="43" errors="0" id="0" time="">
                <testcase name="Ensure auditd is installed" classname="score">
                        <failure message="results do not match" type="fail"></failure>
                </testcase>
                <testcase name="Ensure no duplicate UIDs exist" classname="score"></testcase>
                <testcase name="Ensure root group is empty" classname="score"></testcase>
                <testcase name="Ensure no duplicate group names exist" classname="score"></testcase>
                <testcase name="Ensure source routed packets are not accepted" classname="score">
                        <failure message="results do not match" type="fail"></failure>
                </testcase>
                ...
                <testcase name="Ensure login and logout events are collected" classname="score">
                        <failure message="results do not match" type="fail"></failure>
                </testcase>
        </testsuite>
</testsuites>

@vjeffrey
Copy link
Contributor

works great locally!

@chris-rock chris-rock merged commit 05a85cb into main Jan 23, 2023
@chris-rock chris-rock deleted the chris-rock/junit branch January 23, 2023 21:18
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants