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
JENKINS-27240 - Move xunit to SimpleBuildStep for Workflow support #35
Conversation
@@ -69,7 +69,7 @@ public XUnitProcessor(TestType[] types, XUnitThreshold[] thresholds, int thresho | |||
this.extraConfiguration = extraConfiguration; | |||
} | |||
|
|||
public boolean performXUnit(boolean dryRun, AbstractBuild<?, ?> build, BuildListener listener) | |||
public boolean performXUnit(boolean dryRun, Run<?, ?> build, FilePath workspace, TaskListener listener) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
binary compat issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legit question - does that actually matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, regardless, adding a compat method.
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests. |
An explicit link to the JIRA issue in the description would be appreciated by reviewers. |
} | ||
|
||
public boolean performDryRun(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) | ||
throws InterruptedException, IOException { | ||
try { | ||
XUnitProcessor xUnitProcessor = new XUnitProcessor(getTypes(), getThresholds(), getThresholdMode(), getExtraConfiguration()); | ||
xUnitProcessor.performXUnit(true, build, listener); | ||
xUnitProcessor.performXUnit(true, build, build.getWorkspace(), listener); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if needed, but perhaps you want to adapt performDryRun
too? Could be used somehow from a WF script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
performDryRun
is via https://github.com/jenkinsci/dry-run-lib/blob/master/src/main/java/org/jenkinsci/lib/dryrun/DryRun.java, so had to stay with the existing signature.
🐝 But please, just note that all constructors and methods replacement ( |
BTW did you test the Snippet Generator is working fine for this plugin? |
@abayer Did you consider to add a test (using WF)? |
@amuniz Will add a test, yeah. |
Ok, test still needed, but turned out it wouldn't have worked anyway. =) Snippet generator works now, and I need to figure out how I'd actually test XUnit - turns out there aren't any tests of either |
For the test, you can simulate a workspace with an existent report, like here. There are a lot of report files in src/main/resources that you can use. |
Yeah, just haven't done it yet. |
Specifically fixing a few injections of BuildListener -> TaskListener, and making sure the workflow tests don't fail on old results.
Test added, other stuff fixed along the way. =) |
🐝 |
@reviewbybees done |
This pull request has completed our internal processes and we now respectfully request the maintainers of this repository to consider our proposal contained within this pull request for merging. |
JENKINS-27240 - Move xunit to SimpleBuildStep for Workflow support
Thanks, @gboissinot! |
Nice job @abayer! :) |
@@ -97,15 +116,22 @@ public ExtraConfiguration getExtraConfiguration() { | |||
@Override | |||
public boolean perform(final AbstractBuild<?, ?> build, Launcher launcher, final BuildListener listener) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can delete the old overload. It is inherited from the superclass anyway.
cc @reviewbybees