使用带有parallel

编程入门 行业动态 更新时间:2024-10-27 08:30:02
使用带有parallel_tests的Cucumber会给我一堆未定义的步骤(Using Cucumber with parallel_tests gives me a heap of undefined steps)

我正在努力让parallel_tests使用我的黄瓜功能,因为它允许我更快地运行我的测试。

https://github.com/grosser/parallel_tests/wiki

问题是,当我以这种方式运行我的功能时,我得到了一堆未定义的步骤。 我在这里看到这个问题被提到是一个封闭的问题:

https://github.com/grosser/parallel_tests/issues/22

有了phuong-nguyen,他建议在我的bundle exec命令中添加features / step_definitions功能/支持。 我试过这个方法,如何在我的bundle exec命令中包含这两个目录?

这是我到目前为止所尝试的:

$ bundle exec rake --require features/step_definitions --require features/support parallel:features $ bundle exec features/step_definitions features/support rake parallel:features $ bundle exec rake parallel:features features/step_definitions features/support

更新:

将parallel_tests更新为0.6.1后,以下命令仍然存在相同的问题:

$ bundle exec rake parallel:features features/step_definitions features/support

一些功能通过而其他功能仍然无法找到步骤

I'm trying to get parallel_tests working with my cucumber features as it allows me to run my tests much faster.

https://github.com/grosser/parallel_tests/wiki

Problem is that when I run my features this way I get a heap of undefined steps. I've seen this problem mentioned as a closed issue here:

https://github.com/grosser/parallel_tests/issues/22

With phuong-nguyen he suggests adding features/step_definitions features/support to my bundle exec command. I've tried this every which way, how do I include these two directories in my bundle exec command?

Here is what I've tried so far:

$ bundle exec rake --require features/step_definitions --require features/support parallel:features $ bundle exec features/step_definitions features/support rake parallel:features $ bundle exec rake parallel:features features/step_definitions features/support

Update:

After updating parallel_tests to 0.6.1 the following command still has the same issue:

$ bundle exec rake parallel:features features/step_definitions features/support

Some features pass whilst others still cannot find the steps

最满意答案

我发现如果我将'-r features'添加到我的cucumber.yml std_opts行,那么我现在可以再次并行运行所有的黄瓜测试。

这是我的完整cucumber.yml文件:

<% rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip --tags ~@slow --tags ~@broken -r features" %> default: <%= std_opts %> features all: --format progress --tags ~@broken features slow: --format pretty --strict --tags @slow features broken: --format pretty --strict --tags @broken features wip: --tags @wip:3 --wip features rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip report: --format html --out=features.html report_pdf: --format pdf --out=features.pdf new: --tags @new new_report: --format html --out=features_new.html --tags @new new_report_pdf: --format pdf --out=features_new.pdf --tags @new

I found that if I add '-r features' to my cucumber.yml std_opts line then I can now run all my cucumber tests parallel again.

Here is my full cucumber.yml file:

<% rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip --tags ~@slow --tags ~@broken -r features" %> default: <%= std_opts %> features all: --format progress --tags ~@broken features slow: --format pretty --strict --tags @slow features broken: --format pretty --strict --tags @broken features wip: --tags @wip:3 --wip features rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip report: --format html --out=features.html report_pdf: --format pdf --out=features.pdf new: --tags @new new_report: --format html --out=features_new.html --tags @new new_report_pdf: --format pdf --out=features_new.pdf --tags @new

更多推荐

本文发布于:2023-07-29 20:46:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1319609.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:parallel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!