Skip to content

Add JUnit#2066

Merged
thomas-zahner merged 5 commits into
lycheeverse:masterfrom
thomas-zahner:junit-new
Mar 3, 2026
Merged

Add JUnit#2066
thomas-zahner merged 5 commits into
lycheeverse:masterfrom
thomas-zahner:junit-new

Conversation

@thomas-zahner

@thomas-zahner thomas-zahner commented Feb 26, 2026

Copy link
Copy Markdown
Member

Fixes #614

I experimented both with the SARIF and JUnit XML report format. In the end I've settled for JUnit. I feel like the format is more fitting and it's simpler to integrate. In GitLab it's supported out of the box. In GitHub you would normally use an additional action such as action-junit-report. Using this additional action was easier IMO then setting up the code scanning in GitHub to get the SARIF format to properly work. It seems much more programmatic, where with SARIF you have to do some manual adjustments in the settings and the reported errors are considered "security" issues. With JUnit link check results are treated like tests which are passing, failing, or skipped.

I've made a little demo for GitLab and one for GitHub.

This PR also introduces durations response body. See 2e0060c

Comment thread lychee-bin/src/formatters/stats/json.rs
Comment thread lychee-lib/src/types/response.rs
Comment thread lychee-bin/tests/cli.rs Outdated
Comment thread lychee-bin/src/formatters/stats/junit.rs Outdated
/// Used to store the duration of the run in seconds.
pub(crate) duration_secs: u64,
/// The time it took to perform the full run
pub(crate) duration: Duration,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool and all, and we should keep it. I just want to point out that this is technically a breaking change in the JSON output. E.g. before it was "duration_secs": 0 and I believe now it would be "duration": {"secs": 0, "nanos": 0} or something. Maybe we should point that out in the release notes or in the PR description?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that makes sense 👍

@mre mre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with my review.

@thomas-zahner thomas-zahner force-pushed the junit-new branch 2 times, most recently from 2a00c0f to 3b0b2a9 Compare March 2, 2026 13:14

@mre mre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

thomas-zahner and others added 4 commits March 3, 2026 11:09
Additionally update ResponseStats' duration
Co-authored-by: Matthias Endler <matthias@endler.dev>
@thomas-zahner thomas-zahner merged commit bcf63ea into lycheeverse:master Mar 3, 2026
7 checks passed
@mre mre mentioned this pull request Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate reports for forges

2 participants