Unit test harness - cannot add local plugin for test

33 views
Skip to first unread message

Kirill

unread,
Jul 1, 2015, 11:36:29 AM7/1/15
to jenkin...@googlegroups.com
Hi,

I tried to follow advice in https://wiki.jenkins-ci.org/display/JENKINS/Unit+Test:

"@WithPlugin(NameOfPlugin)

Installs the specified plugin before launching Jenkins in the test. For now, this has to be one of the plugins statically available in resources "/plugins/NAME"."


I need to add plugin "my-plugin" for the test run.


So I added "plugins/my-plugin" directory into my Maven test resources directory, and put my-plugin-1.0.159.hpi there.


Then I put the following annotations for my test: 


@Test
@WithPlugin("my-plugin")

But it wasn't loaded :( What did I do wrong? Jenkins version is 1.580.3.


Is this the same situation as in https://groups.google.com/forum/#!searchin/jenkinsci-dev/plugin$20test/jenkinsci-dev/cQR069bDZGk/f61kDTUYHt0J ?


There's no much details in Wiki entry about what should be done. I think a sample would be grand.

Jesse Glick

unread,
Jul 1, 2015, 1:40:38 PM7/1/15
to Jenkins Dev
On Wed, Jul 1, 2015 at 11:36 AM, Kirill <yam...@gmail.com> wrote:
> So I added "plugins/my-plugin" directory into my Maven test resources
> directory, and put my-plugin-1.0.159.hpi there.
>
> Then I put the following annotations for my test:
>
> @Test
> @WithPlugin("my-plugin")

Use mu-plugin.jpi and @WithPlugin("my-plugin.jpi"). If that works,
file a PR to improve the Javadoc. In the meantime, you can just read
the source code, which is pretty self-explanatory.

Kirill

unread,
Jul 2, 2015, 5:11:48 AM7/2/15
to jenkin...@googlegroups.com
Hi Jesse,

Apologies, I had to take a look at the source code first of all. It was pretty straightforward. Sorry for taking your time!
I have created a JIRA ticket with a suggestion here: https://issues.jenkins-ci.org/browse/JENKINS-29181. Unfortunately, there was no unit-test-harness component, so I attached it to acceptance-test-harness component. Hope that's OK.

Regards,
Kirill.

среда, 1 июля 2015 г., 18:40:38 UTC+1 пользователь Jesse Glick написал:
Reply all
Reply to author
Forward
0 new messages