Testing a master-slave setup when developing a plugin

25 views
Skip to first unread message

Mez Pahlan

unread,
Jul 6, 2019, 9:32:28 AM7/6/19
to Jenkins Developers
Hi everyone!

Whilst developing a plugin I find it really useful to be able to run hpi:run and quickly get an instance of Jenkins with my plugin that I can test. However this only creates a single Master setup. Is there a better / easier way to quickly get a master-slave setup so I can test how my plugin works in a distributed environment? At the moment I am doing the following:

1. hpi:run
2. Configure Jeknins -> Manage Nodes -> Add additional slave
3. Download the JAR file after setting up the new node
4. Run the JAR file in a separate command line process

This is quite tedious but it works. Am I missing something?

Cheers

Ullrich Hafner

unread,
Jul 6, 2019, 9:48:54 AM7/6/19
to Jenkins Developers
There is no predefined way of doing this. 

For my warnings plugin I created a docker based development environment:

I think you can simply adapt that to your needs. You can have a look at the warnings plugin itself, it has a script to build and deploy the plugin to the docker container and restart it.


Cheers

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/211d4658-f955-424c-a435-6f5f21041b82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aldrin Leal

unread,
Jul 6, 2019, 9:57:30 AM7/6/19
to jenkin...@googlegroups.com
you can add a ssl slave to your own local machine. works like a charm.

--

Matt Sicker

unread,
Jul 8, 2019, 11:42:24 AM7/8/19
to jenkin...@googlegroups.com
There's also the DumbSlave class in JTH for testing some agent related things.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALpo8NuRdKxNcuneLpG6gDHk8CqZDvcn8trm_VqOCEmfVgwVCg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Matt Sicker
Senior Software Engineer, CloudBees

Jesse Glick

unread,
Jul 8, 2019, 12:57:51 PM7/8/19
to Jenkins Dev
On Sat, Jul 6, 2019 at 9:32 AM Mez Pahlan <mez.p...@gmail.com> wrote:
> 1. hpi:run
> 2. Configure Jeknins -> Manage Nodes -> Add additional slave
> 3. Download the JAR file after setting up the new node
> 4. Run the JAR file in a separate command line process
>
> This is quite tedious but it works. Am I missing something?

Yes: https://plugins.jenkins.io/mock-slave

Mez Pahlan

unread,
Jul 8, 2019, 3:57:55 PM7/8/19
to Jenkins Developers
Thanks both. Great suggestions. I'll give them a go.

On Monday, 8 July 2019 17:57:51 UTC+1, Jesse Glick wrote:
Reply all
Reply to author
Forward
0 new messages