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

Do not consider a build with unloadable TestResult #247

Merged
merged 4 commits into from May 2, 2023

Conversation

jglick
Copy link
Member

@jglick jglick commented Apr 22, 2023

When junitReport.xml is malformed, https://github.com/jenkinsci/junit-plugin/blob/b4cf28bc7724c49bc93560c7bf95acdca4bbde1b/src/main/java/hudson/tasks/junit/TestResultAction.java#L227-L240 can cause ParallelTestExecutor.getTestResult to nonetheless consider that build a valid baseline, but with zero results which of course causes split calculation to not work sanely. Ignore such builds, and continue searching for better ones, or at worst fall back to source scanning.

@jglick jglick added the bug label Apr 22, 2023
@jglick jglick requested review from Vlatombe and a team April 22, 2023 15:17
TestResult tr = (TestResult) o;
String hyperlink = ModelHyperlinkNote.encodeTo('/' + b.getUrl(), originProject != b.getParent() ? b.getFullDisplayName() : b.getDisplayName());
if (tr.getTotalCount() == 0) {
listener.getLogger().printf("Build %s has no loadable test results (supposed count %d), skipping%n", tra.getTotalCount(), hyperlink);
Copy link
Member Author

Choose a reason for hiding this comment

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

Note persisted Integer totalCount, as opposed to actually loading the results and counting.

(cherry picked from commit 93afed3)
@jglick
Copy link
Member Author

jglick commented Apr 24, 2023

#248 works as a hotfix. Ought to add a test case.

@jglick
Copy link
Member Author

jglick commented Apr 24, 2023

(motivation: jenkinsci/jenkins#7875 / jenkinsci/junit-plugin#520)

Copy link

@julieheard julieheard left a comment

Choose a reason for hiding this comment

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

LGTM 🙂

@jglick jglick merged commit 24f9a14 into jenkinsci:master May 2, 2023
13 checks passed
@jglick jglick deleted the unloadable-results branch May 2, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants