JenkinsRule with a fully customised jenkins-war doesn't populate the plugins when running the tests

44 views
Skip to first unread message

Victor Martinez

unread,
Sep 27, 2019, 2:43:19 PM9/27/19
to Jenkins Developers
Hi there,

I'm using the JTH with the JenkinsRule without the WithPlugin annotation, and I'd like to prepare a jenkins-war with the whole configuration I require for my tests. So I decided to use:

  • The custom-war-packager, with the same GAVC as the one I use with the JTH, to bundle all the required plugins and the JCasC pointing to the shared library. 

Before moving forward with the JTH, I validated the just generated war file works out of the box with the JenkinsFile-Runner in my local.

Unfortunately, the JenkinsRule does not populate all the plugins which were bundled with,

Is that the expected behaviour? Any idea how I can make the JenkinsRule aware of the plugins which are stored in the WEB-INF/plugins/ folder?

Thanks

Jesse Glick

unread,
Sep 27, 2019, 4:13:03 PM9/27/19
to Jenkins Dev
On Fri, Sep 27, 2019 at 2:43 PM Victor Martinez
<victormar...@gmail.com> wrote:
> Unfortunately, the JenkinsRule does not populate all the plugins which were bundled with,
>
> Is that the expected behaviour?

Yes. `JenkinsRule` cares nothing for bundled plugins. Only plugins in
the test classpath are loaded.

Did you really want to use `acceptance-test-harness` or something? I
think you are using `jenkins-test-harness` for something well outside
its design space.

Victor Martinez

unread,
Sep 29, 2019, 8:36:36 AM9/29/19
to Jenkins Developers
Thanks Jesse, indeed I'm using the JenkinsRule for some non UI integrations tests.

Why did I ask for such a specific question?

My aim is to ensure the shared library has been tested not just using the JenkinsPipelineUnit but a more realistic use cases, therefore I can minimise the chances to find any errors either when the CI ecosystem is updated/upgraded and help to use Gherkin or a similar BDD approach to help to any of the users.

A kind of similar approach has been done with JCasC, for instance https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos/active-directory is now validated using a specific IT:

The complexity of that particular approach is to define all the dependencies, including the ones which should be excluded, for instance: https://github.com/jenkinsci/configuration-as-code-plugin/pull/1080#issuecomment-536287707 . Within the maven POM file.

That's the reason I wanted to use the CWP to help to build the customised Jenkins war with the plugins which are required to be used within the JenkinsRule.

ATH might be too overkilling as I'm not interested in using the UI though.

Any suggestions/approaches to tackle this?

Thanks
Reply all
Reply to author
Forward
0 new messages