简体   繁体   English

有没有办法并行运行机器人框架测试套件?

[英]Is there any way to run robot framework test suites in parallel?

I have 5 test suites which are independent of each other. 我有5个相互独立的测试套件。 I have to run it against the same environment. 我必须针对相同的环境运行它。 Most of my test suites consist of API calls. 我的大多数测试套件都包含API调用。 The test cases inside the suites should run in sequence as they are dependent on each other. 套件内的测试用例应按顺序运行,因为它们相互依赖。

Is there any way we can run all the test suites in parallel via the pybot command? 有没有什么办法可以通过pybot命令并行运行所有测试套件?

There is no native handling of parallel executions of tests in Robot Framework. Robot Framework中没有本地处理并行执行测试的方法。 There is Pabot, a parallel executor for RF . Pabot是RF的并行执行器 Pabot allows test suite distribution and makes a combined report and log. Pabot允许测试套件分发并组合报告和日志。

We also at Workshare had our take on the matter (at the time we did not know about Mikko work) and we recently open sourced it. 我们也在Workshare处理了这件事(当时我们不知道Mikko工作),我们最近开源了。 It's now production level, as we use it to launch in parallel our tests on our CI (jenkins). 它现在是生产级别,因为我们使用它来并行启动我们的CI(jenkins)测试。 It can produce a complete final report, it can rerun failed tests, it has a global setup/teardown mechanism, it generates xunit compatibles result files, and it also works on Windows :) (altough Linux is a better option!) 它可以生成一个完整的最终报告,它可以重新运行失败的测试,它有一个全局设置/拆卸机制,它生成xunit兼容结果文件,它也适用于Windows :)(尽管Linux是一个更好的选择!)

You find it at: https://github.com/workshare/parallel_pybot 您可以在以下网址找到它: https//github.com/workshare/parallel_pybot

When the tests are completely stand-alone and can run completely parallel I have had some success with just writing an execution script that iterates through all the IP addresses of the units on which I would want to run a test in parallel and then calling the test with that IP address as an argument. 当测试完全独立并且可以完全并行运行时,我已经取得了一些成功,只需编写一个执行脚本,该脚本遍历我想要并行运行测试的单元的所有IP地址,然后调用测试以该IP地址作为参数。 I also tell it to only create the output.xml files, naming them based on the hostname or IP address, and then the scrip does post-processing with rebot which creates an aggregated report with all the units. 我还告诉它只创建output.xml文件,根据主机名或IP地址命名它们,然后脚本使用rebot进行后处理,这会创建一个包含所有单元的聚合报告。

The simple solution is using Jekins: 简单的解决方案是使用Jekins:

  1. You could install Jeknins with robotframework plugin.You can have two job run in parallel by default without any slave node. 您可以使用robotframework插件安装Jeknins。默认情况下,您可以并行运行两个作业,而不需要任何从属节点。
  2. Or you have have multiple slave node, then using tag in robot and node label to distribute job. 或者您有多个从属节点,然后在机器人和节点标签中使用标签来分配作业。

Just set the parameter in Jenkins job build section, such as: 只需在Jenkins作业构建部分中设置参数,例如:

  1. pybot --include tag1 test.robot for job1 pybot --include tag1 test.robot for job1
  2. then set pybot --include tag2 test.robot for job2. 然后为job2设置pybot --include tag2 test.robot。

Then trigger upstream job. 然后触发上游作业。 you will get them running in parallel. 你会让它们并行运行。

But still you need to make sure the file you accesing is locked by one of the testing job. 但是仍然需要确保您访问的文件被其中一个测试作业锁定。

暂无
暂无

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

相关问题 如何并行运行机器人框架测试用例而不是并行运行测试套件? - How to run robot framework test cases parallel and not Test Suite parallel? 在使用 run.py 的单次运行中,在机器人框架中使用各自的排除标签运行不同的测试套件? - Running different test suites with respective exclude tag in robot framework in a single run using run.py? 在Robot框架中跨测试套件设置会话cookie - Set session cookie across the test suites in Robot framework 在Robot Framework中循环运行单个测试 - Run a single test in loop in Robot Framework 如何在机器人框架中运行特定的测试用例 - how to run specific test cases in robot framework 有什么方法可以减少 Robot Framework 中的套件设置/拆卸和测试设置/拆卸样板? - Any way to reduce suite setup/teardown and test setup/teardown boilerplate in Robot Framework? 有什么办法,我可以通过条件检查和忽略机器人框架中的错误来运行关键字 - Is there any way , I can run keyword by condition checking and ignoring error in robot framework 我无法在 RIDE (ROBOT FRAMEWORK) 中运行简单的测试 - I can't run a simple test in RIDE (ROBOT FRAMEWORK) 机器人框架 - 如何在测试运行期间使用 chrome 中的开发人员工具? - Robot framework - how to work with developer tools in chrome during test run? 运行机器人框架测试而不将其放入模板文件中 - Run robot framework test without put it in the template file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM