CNF-23887: Populate JUnit XML timestamp, hostname, and duration#64
CNF-23887: Populate JUnit XML timestamp, hostname, and duration#64sebrandon1 wants to merge 1 commit into
Conversation
The JUnit XML testsuite element was missing standard attributes that CI systems expect. Add timestamp, hostname, and time attributes, and expose scan duration in both JUnit XML and JSON output. - Add Duration and DurationSeconds fields to ScanResults - Compute duration centrally in assembleResults - Populate testsuite timestamp, hostname, time in JUnit XML - Add hostname() helper with os.Hostname fallback
|
@sebrandon1: This pull request references CNF-23887 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sebrandon1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@sebrandon1: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
timestamp,hostname, andtimeattributes on the JUnit XML<testsuite>element — these are standard JUnit attributes expected by CI systems like Prow and JenkinsDurationfield toScanResults, computed centrally inassembleResultsduration_seconds(float64) to JSON output for human-readable scan timing (time.Durationis suppressed from JSON since it serializes as nanoseconds)Jira: CNF-23887
Before
After
JSON output (new field)
{ "timestamp": "2026-05-14T13:59:05-05:00", "duration_seconds": 1754.19 }Test plan
go build ./...passesgo test ./...passes--junit-fileand--json-fileconfirms all three attributes populated