And see also https://javadoc.jenkins.io/component/jenkins-test-harness/org/jvnet/hudson/test/HudsonTestCase.html#useLocalPluginManager
Björn Pedersen schrieb am Freitag, 6. August 2021 um 09:38:13 UTC+2: > And take a look at > https://javadoc.jenkins.io/component/jenkins-test-harness/org/jvnet/hudson/test/RestartableJenkinsRule.html > > , especially the info about > UnitTestSupportingPluginManager. > > Björn > > > Björn Pedersen schrieb am Freitag, 6. August 2021 um 09:32:14 UTC+2: > >> I guess this question is better suited for >> https://groups.google.com/g/jenkinsci-dev >> >> [email protected] schrieb am Donnerstag, 5. August 2021 um 16:48:48 >> UTC+2: >> >>> Thanks for the reply. It looks like your repo is similar to >>> https://github.com/sheehan/job-dsl-gradle-example/, which is the >>> example that our repo is based on as well. We've got Specifications that >>> test the job DSL syntax and other job configuration stuff. And I see how >>> the resolveTestPlugins task in build.gradle saves plugins to the >>> build/resources/test/test-dependencies folder that the Jenkins test harness >>> will look in to get the plugins with which to load the in-memory Jenkins >>> instances. >>> >>> What I want to do is load those in-memory Jenkins instances spun up by >>> the Jenkins test harness with different plugins, depending on the >>> Specification being run. So for most Specifications, I'll use one set of >>> plugins, but for another set of Specifications, I'd like to use another... >>> >>> I thought that `new JenkinsRule().with(MyPluginManager.INSTANCE)` or >>> something like that would solve this issue for me, but I'm having trouble >>> with it. I'm seeking help on how to get this to work. >>> >>> I've updated my StackOverflow question with a link to a GitHub repo that >>> reproduces the problem I'm seeing: >>> https://github.com/matthiasdenu/plugin-manager-bug/tree/main >>> >>> Help is appreciated! >>> >>> On Wednesday, June 30, 2021 at 12:15:42 PM UTC-4 [email protected] >>> wrote: >>> >>>> We do not use Spock, but we have a process to test jobDSL definitions >>>> before applying changes see >>>> https://github.com/elastic/apm-pipeline-library/tree/master/.ci/jobDSL >>>> it test that the syntax is correct and test that you can create the job. >>>> Probably the class that helps you is >>>> https://github.com/elastic/apm-pipeline-library/blob/master/.ci/jobDSL/src/test/groovy/JobScriptsSpec.groovy >>>> >>>> , also it is really tricky to configure the plugins you need on >>>> https://github.com/elastic/apm-pipeline-library/blob/master/.ci/jobDSL/build.gradle#L29-L68 >>>> >>>> El miércoles, 30 de junio de 2021 a las 16:33:56 UTC+2, >>>> [email protected] escribió: >>>> >>>>> Hi, I'm trying to use a different set of plugins for different Spock >>>>> Specifications. I've posted a more detail question here: >>>>> https://stackoverflow.com/questions/68196423/trouble-using-a-base-spock-specification-and-jenkinsrule-with-pluginmanager >>>>> >>>>> I'm hoping that someone might be able to provide some insight. Thank you. >>>> >>>> -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/76ef10c3-148b-4af2-b92a-3ebf40029afen%40googlegroups.com.
