简体   繁体   中英

How to run a robotframework job on a Jenkins CI slave node

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
该图像显示也不可以输入任何内容,或者提示oF Server不显示任何其他IP地址

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM