Spork在自动测试中反复重新运行失败的测试 [英] Spork is repeatedly re-running failing tests in autotest

查看:114
本文介绍了Spork在自动测试中反复重新运行失败的测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个新项目,我正在尝试使用rspec,autotest和spork启动并运行.

I have a new project that I am trying to get up and running with rspec, autotest and spork.

我正在使用:

  • 轨道3.0.4

  • rails 3.0.4

rspec 2.5.0

rspec 2.5.0

spork 0.9.0.rc3

spork 0.9.0.rc3

自动测试4.4.6

Spork似乎加载得很好(我收到一条消息,它正在侦听端口),但是当我运行自动测试且测试失败时,它将一遍又一遍地重新运行该测试.它应该只运行测试,看看它失败并停止.知道为什么会发生这种行为吗?

Spork seems to be loading fine (I get a message that it is listening on a port), but when I run autotest with a failing test, it reruns that test over and over. It should just run the test, see that it is failing and stop. Any idea why this behavior is happening?

此外,一旦我通过了失败的测试,自动测试就会停止.如果我随后对代码进行了更改,则测试将无法运行,我需要按Ctrl-C进行自动测试才能看到更改.

Also, once I make the failing tests pass, autotest stops as it should. If I then make a change to the code, the tests don't get run and I need to Ctrl-C to have autotest see the changes.

感谢您的帮助!

推荐答案

您确定这与spork有关吗?我只是解决了自动测试和无休止循环的类似问题,在该循环中,某些组件(在这种情况下为simplecov)不断更新目录中的文件,而自动测试则将它们更改后重新拾取,因此重新进行了测试. 要解决该问题,请找出spork是否将其写入树中的某个文件/目录,并将其添加到例外列表中以进行自动测试,如下所示:

Are you sure that this is related to spork? I just fixed a similar problem with autotest and an endless loop, where some component (simplecov in that case) kept updating files in the directory and autotest picked them up as being changed and therefore reran the tests. To solve the problem, find out if spork writes to some file/directory in your tree and add this to the exception list for autotest like so:

~/ruby/project$ cat .autotest
Autotest.add_hook :initialize do |at|
  at.add_exception(%r{^\./\.git})
  at.add_exception(%r{^\./your_culprit})
end

也许 github 上的文档更清楚了.
希望这会有所帮助

Maybe the docu on github makes it more clear.
Hope this helps

这篇关于Spork在自动测试中反复重新运行失败的测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆