How can I have autospec/test not run the full test suite after everything goes green?

时光毁灭记忆、已成空白 提交于 2019-12-03 09:15:32

Bit late but I was looking for this as well so thought I'd post my solution:

Add the following to ~/.autotest:

class Autotest
  def rerun_all_tests
  end
end

Are you sure you are not confused about the intended behaviour of autotest's heuristics?

My understanding is that it runs tests for what has changed and will keep running failed tests until they pass and then once they pass it runs the whole test suite to make sure nothing else broke.

In effect it is being conservative and making sure you haven't introduced side effects that break other unrelated tests which is probably a good thing. The problem of course is that if you are doing fast red - green cycles you are going to be running your full suite a lot.

If you want to change these behaviours you need to edit the heuristics in the rails_autotest.rb file for zentest.

You can use the following option to avoid this behavior -

autospec --no-full-after-failed

I think that this is by design - if you fix a failing spec, and all other specs in the section are green, then autospec will rerun the entire suite - this will tell you if the fix you applied to one area of your project has b0rked another or not.

If you just want to run the specs you are working on at any one time, then you can do it from the command line:

ruby spec/controllers/my_spec.rb

or from within Textmate by pressing cmd+r from your spec file. You should rerun your entire suite as you go anyway, otherwise you might be missing failing specs.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!