简体   繁体   English

为Robot Framework设置Jenkins工作区

[英]Setting Jenkins workspace for Robot Framework

I have a web project with two existing Jenkins jobs: One for building and one for deploying the application. 我有一个包含两个现有Jenkins作业的Web项目:一个用于构建,另一个用于部署应用程序。 Now I've created a third job which should run a Robot test suite. 现在我已经创建了第三个应该运行Robot测试套件的工作。 The problem is that it does not find the right directory when pybot command is given in shell script (apparently jenkins tries to find it in /home/jenkins/apache/apache-tomcat-7.0.26/temp/hudson1176412779575315348.sh). 问题是,当在shell脚本中给出pybot命令时,它找不到正确的目录(显然jenkins试图在/home/jenkins/apache/apache-tomcat-7.0.26/temp/hudson1176412779575315348.sh中找到它)。

Robot test suite is included in version control, but how should Jenkins be configured so that it finds the test? 机器人测试套件包含在版本控制中,但是如何配置Jenkins以便找到测试? The new job has source code management set to none because the previous jobs (build&deployment) will deploy and start the application. 新作业将源代码管理设置为无,因为先前的作业(构建和部署)将部署并启动应用程序。

Or should I just abandon the idea of a separate robot test job and try to add the robot suite as a step to the deployment job? 或者我应该放弃单独的机器人测试工作的想法,并尝试添加机器人套件作为部署工作的一个步骤?

I think it is a good idea to have a separate job for your Robot Tests. 我认为为你的机器人测试分别做一份工作是个好主意。 You might want to launch your test even if there is no new build or deploy of your SUT (eg because you added a test). 即使没有新的构建或部署SUT,您也可能希望启动测试(例如,因为您添加了测试)。

So, if your Software under test is already deployed and up and running when your Robot Jenkins job starts, you still have to do a "source code management" step to download the source of your test on your slave in the workspace of your job. 因此,如果您的Robot Jenkins作业启动时已经部署并启动并运行了您正在测试的软件,您仍然需要执行“源代码管理”步骤,以便在您的工作空间中下载您的测试源。 And then in the build section you will have a shell step that actually launch the Robot Tests. 然后在构建部分中,您将有一个实际启动机器人测试的shell步骤。

If you get an error like 如果你收到错误的话

$ pybot mytest.txt
[ ERROR ] Parsing 'mytest.txt' failed: Data source does not exist.

Then it means your Robot tests were not downloaded on your slave in your workspace. 然后,这意味着您的机器人测试未在工作区中的奴隶上下载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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