可能“快速失败".进行带有minitest 5的rake测试时? [英] Possible to "fail fast" when running rake test w/ minitest 5?
问题描述
是否可以将"rake测试"配置为在遇到故障/异常后立即停止运行测试?
Is it possible to configure 'rake test' to stop running tests as soon as it hits a failure/exception?
我的设置:
- Rails 4.1
- 最低5.3.4
- 抽头(用于格式化)
我想启动测试套件,并在测试失败后立即停止-默认行为是继续运行所有测试,在某些情况下,这会导致数据过多(尤其是一个小错误会导致大量测试)测试突然失败.)
I'd like to start the test suite and immediately stop if a test fails -- the default behavior is to keep running all the tests which, in some cases, is too much data (especially one small bug causes a ton of tests to suddenly fail.)
通过遵循以下要点,我对早期版本的Minitest(4.x)和Turn gem进行了很好的设置:(为minitest/turn/minitest-rails添加一个简单的快速失败选项),但是我现在正在开发新的Rails 4.1应用,Turn与Minitest 5不兼容( ).
I had a nice little setup going with the older version of Minitest (4.x) and the Turn gem by following this gist: (Add a simple fail-fast option to minitest/turn/minitest-rails), but I'm working on a new Rails 4.1 app right now and Turn isn't compatible with Minitest 5 (yet).
有什么想法吗?
推荐答案
如果您使用的是Rails 5,请尝试rails test -f
将快速失败".这意味着如果您运行rails test -h
If you are using Rails 5, try rails test -f
will 'fail fast'. It means abort test run of first failure or error if you run rails test -h
这篇关于可能“快速失败".进行带有minitest 5的rake测试时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!