I have already setup the jenkins master and slave using the java web app as advised and I am using the Jenkins master on Windows 7 and the slave on windows Vista , the question now being how to have a simple job run on the slave as part of the masters build process.
The job that has to be run on the slave is a robotframework test script.
Please be clear that the connection is already established between the master and the slave.
Even if we forget this whole scenario how can we run a simple "echo "Hello World "" script on the slave.
Even when we browse the slave through the standard jenkins interface there is no option which says make a remote job, Ofcourse there is a Remote Parameterized build but no server shows up in the configuration(which begs the question am I doing it right ) but as I have already configured another machine as a slave I think it is quite right that the name does not show up in the Server tab...
This is the image for the remote parameterized build part
Asked
Active
Viewed 4,405 times
1

Nishrin Trunkwala
- 109
- 2
- 11
1 Answers
3
In Jenkins job configuration there should be a checkbox "Restrict where this project can be run". Select it and type your Jenkins slaves name "Toshiba" into textbox under it. This forces Jenkins to run jobs only on it.
Better solution would be to add "robot" label to this slave and use it as restriction in job. You may later add more Robot Framework jobs and find that this one slave is not enough. If you then add more slaves and label them as "robot", Jenkins would choose an available slave.
Update:
So you want to run make command on master and pybot on slave. In Jenkins you can run one job only in one host. This means you must have two jobs: make and robot. Usually they look something like this:
Make
- Get sources from version control
- Make
- Save built binaries as artefacts
- Trigger Robot job
Robot
- Use Build after other projects are built to trigger start of this job. Specify Make build as project to watch
- Get Robot test code from version control
- Copy built binaries from Make job (=artefacts)
- Install binaries
- Run tests
- Publish results

Pekka
- 2,175
- 15
- 20
-
But this checks out the whole project on that slave and then does make. I just want to run robotframework on the remote slave and publish those results on the master node. How can this be done ? (If at all) because the slave does not have the requisite setup to perform the build steps. – Nishrin Trunkwala Sep 18 '15 at 08:23
-
And are you the same Pekka Klarke that has given the robotframework tutorials (Or something significant regarding) robotframework as I came across during my research and study the previous days, Quite lucky and fortunate for me to directly talk to somebody who has been developing this wonderful project. – Nishrin Trunkwala Sep 18 '15 at 08:26
-
I am not Pekka Klärk. You should create a new job that does only Robot Framework tests and make your build job trigger it. – Pekka Sep 18 '15 at 08:38
-
By job you mean a "Trigger remote parameterized job" ? – Nishrin Trunkwala Sep 18 '15 at 08:47
-
The "Publish results" is somewhat complicated as the results will be on the slave machine – Nishrin Trunkwala Sep 18 '15 at 09:08
-
It does not matter, if you define robot output files as artefacts, you can still see them in Jenkins web UI. All your Robot logs will be available and visible in that test job. If you install Robot Plugin into Jenkins, it will show nice graphs about your test. – Pekka Sep 18 '15 at 09:11
-
I am inclined to give a thumbs up to this answer but let me please just put precept to practice, thnx for the pains endured – Nishrin Trunkwala Sep 18 '15 at 09:22
-
This is the last question regarding this I swear. I have a simple script "echo "Hello World"". How do I run it on the slave machine from the master. Forget the checkouts , forget robotframework and forget everything else. I cannot figure out the type ofjob that is needed and the type of linkage. Please help. This solves all of my queries. Is there a plugin that I am missing. – Nishrin Trunkwala Sep 18 '15 at 09:38
-
By a job you mean a new project i guess. – Nishrin Trunkwala Sep 18 '15 at 09:44
-
You are correct, I meant project instead of job. Your way of thinking is a bit wrong. You don't run a project on "slave machine from master". You run a project on slave machine. You can configure a project to start after another project is finished. This is closed to thing to starting "project on slave from master" that Jenkins has. Answer in next comment – Pekka Sep 18 '15 at 09:51
-
Answer to your question: you have a project WMSDK_1 and when it is finished, you want to start "hello world" on slave. 1) create a new project 2) click "Restrict where this project can be run" checkbox and type "Toshiba" into "Label Expression" textbox. 4) Create a build script that prints "hello world" 5) In build triggers, select "Build after other projects are built" 6) In "Projects to watch", type WMSDK_1 – Pekka Sep 18 '15 at 09:53
-
There is one more problem that i have been able to call the pybot scripts on the remote machine but there too the GUI testing does not occur at all instead test results are marked as failed, ever come across such thing ?? – Nishrin Trunkwala Sep 18 '15 at 12:02
-
Are you running Jenkins as a service in your slave host? Service applications have trouble using GUI in Windows. Check this answer: https://stackoverflow.com/questions/19441324/how-to-run-gui-tests-on-a-jenkins-windows-slave-without-remote-desktop-connectio – Pekka Sep 18 '15 at 12:31
-
Things have worked out pretty well after i triggered a hello world on the slave, then GUI testing is working fine although no browsers or anything opens on the slave but yet testing is done for the good. – Nishrin Trunkwala Sep 19 '15 at 07:24