Documentation
¶
Overview ¶
Package junit renders engine reports as JUnit XML, the test-report format Jenkins (the junit step), GitLab (artifacts:reports:junit) and Azure Pipelines (PublishTestResults) display. Shared by the CLI's --output junit and the server's /api/v1/gate?format=junit endpoint.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
Write renders the report as JUnit XML: one <testsuite> per finding category, in a fixed order, with one <testcase> per finding (name: its key; classname: upgradescope.<category>), and a not-assessed suite with one test case per capability gap. Outcomes follow the gate in opts, so the test report fails exactly when `scan --fail-on` does:
- a finding at or above FailOn is a <failure> (type: its severity; message: its title; text: evidence, objects as file:line, fix and references); below it, the test case passes and the same text is its <system-out>;
- a finding unchanged since the baseline, and a suppressed finding (test case "<key> (suppressed)"), is <skipped> with the reason;
- a required gap the gate fails on (the target, always; any other unless AllowIncomplete) is an <error>: the verdict is unknown; every other gap is <skipped>, the check not having run.
A report with none of these is one passing test case ("no findings", suite readiness), since Jenkins fails a build whose reports hold no tests. Any gap, even a skipped optional one, adds a not-assessed suite instead, so that case appears only when every check ran: a live scan. A clean files-mode scan is one skipped test per optional check that did not run (deprecated-calls, helm, versions) and none passed. Times are 0. A failed write is returned.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package junittest reads JUnit XML as CI systems do and validates it against the Jenkins JUnit schema (the xUnit plugin's junit-10.xsd, vendored under testdata), for every package that emits JUnit (the CLI's --output junit and the server's /api/v1/gate?format=junit).
|
Package junittest reads JUnit XML as CI systems do and validates it against the Jenkins JUnit schema (the xUnit plugin's junit-10.xsd, vendored under testdata), for every package that emits JUnit (the CLI's --output junit and the server's /api/v1/gate?format=junit). |