黄瓜用标签自动重新运行失败的情况? [英] cucumber re-run failed scenarios automatically with a tag?
问题描述
在我们的构建中,某些方案由于某些原因而失败,这些原因是我们无法控制的,或者花费太长时间才能正确调试.诸如异步javascript等之类的东西.
In our build there are certain scenarios that fail for reasons which are out of our control or take too long to debug properly. Things such asynchronous javascript etc.
无论如何,关键是有时它们有时起作用,而有时却不起作用,所以我想将标签添加到诸如@rerun_on_failure或@retry之类的方案中会很好,它们会在失败之前重试该方案n次.构建.
Anyway the point is sometimes they work sometimes they don't, so I was thinking it would be nice to add a tag to a scenario such as @rerun_on_failure or @retry which would retry the scenarion X number of times before failing the build.
我知道这不是理想的解决方案,但是测试仍然很有价值,我们希望保留它,而不会产生误报
I understand this is not an ideal solution, but the test is still valuable and we would like to keep it without having the false negatives
失败的实际测试将单击一个链接,并期望将跟踪事件发送到服务器进行分析(通过javascript).有时,硒Web驱动程序加载下一页的速度太快,事件没有时间发送.
The actual test that fails clicks on a link and expects a tracking event to be sent to a server for analytics (via javascript). Sometimes the selenium web-driver loads the next page too fast and the event does not have time to be sent.
谢谢
推荐答案
我一直在考虑编写类似于您所描述的内容,但是我发现了这一点:
I've been considering writing something like what you're describing, but I found this:
如果您由于不确定的故障而不得不重新启动CI服务器中的构建,则此帖子适合您.
If you're tired of having to re-kick builds in your CI server because of non deterministic failures, this post is for you.
简而言之:他做了一个新的rake任务,叫做Cucuming:rerun,它使用rerun.txt重试失败的测试.在其中添加一些循环以最多重试3次(例如)应该很容易.
In a nutshell: he makes a new rake task called cucumber:rerun that uses rerun.txt to retry failed tests. It should be pretty easy to add some looping in there to retry at most 3x (for example).
这篇关于黄瓜用标签自动重新运行失败的情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!