How to run tests on slave/agent

24 views
Skip to first unread message

Rajeev Ranjan

unread,
Jul 8, 2019, 4:14:37 AM7/8/19
to Jenkins Developers
Hi Team,
I have some unit tests which is running fine when invoked directly but I want to ensure it is running fine on slave agent also. Ho can I configure my automation to run the tests on windows slaves?
Is these any documentation for the same. I referred https://jenkins.io/doc/developer/testing/ for help but here mocking agent part is marked as todo. Can you please redirect me to documentation for the same.
Thanks in advance.

Regards
Rajeev Ranjan

Ullrich Hafner

unread,
Jul 8, 2019, 9:48:10 AM7/8/19
to Jenkins Developers

Am 08.07.2019 um 10:14 schrieb Rajeev Ranjan <rajeevr...@gmail.com>:

Hi Team,
I have some unit tests which is running fine when invoked directly but I want to ensure it is running fine on slave agent also. Ho can I configure my automation to run the tests on windows slaves?

I don’t think that there is an option to automatically run tests on a Windows agent as you need an OS installation on the agent. 
If you are running locally on Windows then you can write an integration test using a DumbSlave

(Running tests on a Unix based docker agent is simpler.)

Is these any documentation for the same. I referred https://jenkins.io/doc/developer/testing/ for help but here mocking agent part is marked as todo. Can you please redirect me to documentation for the same.
Thanks in advance.

There is no such documentation yet. I hopefully find some time to add some more content in a couple of weeks…
 

Regards
Rajeev Ranjan

--
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/5e90709f-1c27-4b1b-a879-8443b7c143bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jesse Glick

unread,
Jul 8, 2019, 12:57:03 PM7/8/19
to Jenkins Dev
On Mon, Jul 8, 2019 at 4:14 AM Rajeev Ranjan <rajeevr...@gmail.com> wrote:
> I have some unit tests which is running fine when invoked directly but I want to ensure it is running fine on slave agent also.

Just use `JenkinsRule.createSlave`, and then configure the job to use
that agent. Plenty of tests do this.

Rajeev Ranjan

unread,
Jul 10, 2019, 1:38:53 PM7/10/19
to Jenkins Developers


Thanks Jesse and Ullrich, Neat and organised at such large scale. :)
I did something like this at crux.

DumbSlave node = jenkins.createSlave("node", "", null);
project.setAssignedNode(node);
project.getBuildersList().add(builder);
FreeStyleBuild build = jenkins.buildAndAssertSuccess(project);


Reply all
Reply to author
Forward
0 new messages