Skip to content

[JENKINS-48885] - Fix getPlugin() in JenkinsRule#92

Draft
oleg-nenashev wants to merge 2 commits intojenkinsci:masterfrom
oleg-nenashev:bug/JENKINS-48885
Draft

[JENKINS-48885] - Fix getPlugin() in JenkinsRule#92
oleg-nenashev wants to merge 2 commits intojenkinsci:masterfrom
oleg-nenashev:bug/JENKINS-48885

Conversation

@oleg-nenashev
Copy link
Member

WiP for now, just to not forget about it.

https://issues.jenkins-ci.org/browse/JENKINS-48885

@reviewbybees

pom.xml Outdated
<!--to have access to User.getById-->
<version>1.651.2</version>
<!--to run with plugin unbundling by default-->
<version>2.7.3</version>
Copy link
Member

Choose a reason for hiding this comment

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

Then you would need to do some cleanup. TestPluginManager has distinct modes for 1.x vs. 2.x.

Copy link
Member

Choose a reason for hiding this comment

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

…which I guess did not get cleaned up in #135, so maybe do that here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe we will wipe 1.x entirely after https://groups.google.com/forum/#!topic/jenkinsci-dev/SdMOMKs7XIQ

for (String plugin : a.value()) {
URL res = getClass().getClassLoader().getResource("plugins/" + plugin);
if (res == null) {
throw new IOException("Cannot find resource for plugin " + plugin);
Copy link
Member

Choose a reason for hiding this comment

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

This only applies to tests actually annotated with @WithPlugin. No effect on tests assuming plugin existence due to a test-scoped dependency.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. It is not really related to the defect. Just better diagnostics for another issue I hit. Can detach it to a separate PR if you prefer

Choose a reason for hiding this comment

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

I think I've been impacted by this issue too doing some tests in support-core plugin. Here the folder plugins doesn't exist: https://github.com/jenkinsci/support-core-plugin/blob/54fde93fa28ac1c69adc0a2a6c4962ca2c629b3c/src/main/java/com/cloudbees/jenkins/support/impl/AboutJenkins.java#L837

Copy link
Member Author

Choose a reason for hiding this comment

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

IIRC the plugin registry is just not initialized in the Test plugin manager

@oleg-nenashev
Copy link
Member Author

I plan to revisit it using the approach suggested in jenkinsci/jenkinsfile-runner#389 and jenkinsci/jenkinsfile-runner#390.

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.

3 participants