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

JENKINS-27240 - Move xunit to SimpleBuildStep for Workflow support #35

Merged
merged 6 commits into from Jan 15, 2016

Conversation

abayer
Copy link
Member

@abayer abayer commented Jan 12, 2016

cc @reviewbybees

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

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

binary compat issue

Copy link
Member Author

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?

Copy link
Member Author

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.

@ghost
Copy link

ghost commented Jan 12, 2016

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.

@jenkinsadmin
Copy link
Member

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

@amuniz
Copy link
Member

amuniz commented Jan 13, 2016

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);
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

@amuniz
Copy link
Member

amuniz commented Jan 13, 2016

🐝

But please, just note that all constructors and methods replacement (AbstractBuild -> Run) is binary incompatible with callers using the old signature (even being source compatible). If there is nothing using the public API of this plugin (which is anything public - that's what we have -) this PR looks good, but a quick search on GitHub (under jenkinsci org) would be nice.

@amuniz
Copy link
Member

amuniz commented Jan 13, 2016

BTW did you test the Snippet Generator is working fine for this plugin?

@amuniz
Copy link
Member

amuniz commented Jan 13, 2016

@abayer Did you consider to add a test (using WF)?

@abayer
Copy link
Member Author

abayer commented Jan 13, 2016

@amuniz Will add a test, yeah.

@abayer
Copy link
Member Author

abayer commented Jan 13, 2016

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 XUnitBuilder or XUnitPublisher currently, just of the parsing and transform, so there's nowhere for me to copy-paste from. =)

@amuniz
Copy link
Member

amuniz commented Jan 13, 2016

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.

@abayer
Copy link
Member Author

abayer commented Jan 13, 2016

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.
@abayer
Copy link
Member Author

abayer commented Jan 13, 2016

Test added, other stuff fixed along the way. =)

@amuniz
Copy link
Member

amuniz commented Jan 14, 2016

🐝

@abayer
Copy link
Member Author

abayer commented Jan 15, 2016

@reviewbybees done

@ghost
Copy link

ghost commented Jan 15, 2016

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.

gboissinot added a commit that referenced this pull request Jan 15, 2016
JENKINS-27240 - Move xunit to SimpleBuildStep for Workflow support
@gboissinot gboissinot merged commit ebae1d9 into jenkinsci:master Jan 15, 2016
@abayer
Copy link
Member Author

abayer commented Jan 15, 2016

Thanks, @gboissinot!

@emanuelez
Copy link
Member

Nice job @abayer! :)

@@ -97,15 +116,22 @@ public ExtraConfiguration getExtraConfiguration() {
@Override
public boolean perform(final AbstractBuild<?, ?> build, Launcher launcher, final BuildListener listener)
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants