Re: Trouble using JenkinsRule with PluginManager

2021-08-06 Thread 'Björn Pedersen' via Jenkins Users
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
>>
>> matthi...@outlook.com 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 kuisat...@gmail.com 
>>> 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, 
 matthi...@outlook.com 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/76ef10c3-148b-4af2-b92a-3ebf40029afen%40googlegroups.com.


Re: Trouble using JenkinsRule with PluginManager

2021-08-06 Thread 'Björn Pedersen' via Jenkins Users
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
>
> matthi...@outlook.com 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 kuisat...@gmail.com 
>> 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, 
>>> matthi...@outlook.com 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/aa2c6530-877f-46d0-84c5-772cbc088bf1n%40googlegroups.com.


Re: Trouble using JenkinsRule with PluginManager

2021-08-06 Thread 'Björn Pedersen' via Jenkins Users
I guess this question is better suited 
for https://groups.google.com/g/jenkinsci-dev

matthi...@outlook.com 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 kuisat...@gmail.com 
> 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, 
>> matthi...@outlook.com 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5130cc41-fefc-4b04-a9a8-2c7838f5a57cn%40googlegroups.com.


Re: Trouble using JenkinsRule with PluginManager

2021-08-05 Thread Matthias Denu
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 kuisat...@gmail.com 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, 
> matthi...@outlook.com 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5b3b417f-0a03-4882-a559-30f9dda05e4fn%40googlegroups.com.


Re: Trouble using JenkinsRule with PluginManager

2021-06-30 Thread Ivan Fernandez Calvo
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, 
matthi...@outlook.com 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/402a9608-e467-4f21-b66c-634d3e8894dcn%40googlegroups.com.


Trouble using JenkinsRule with PluginManager

2021-06-30 Thread Matthias Denu
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4f148db0-39c1-4d17-9d21-3fc2fdeaef5dn%40googlegroups.com.