开发者

Re-running failed and not-run tests in IntelliJ IDEA

Let me describe a simple use-case:

Running all tests in our project may take up to 10 minutes.

Sometimes I see an obvious bug in my code after the first failed开发者_如何学编程 test, so I want to stop running all tests, fix the bug and re-run them. Unfortunately, I can either re-run all tests from the beginning, or re-run failed tests only.

Is there a plugin for IDEA which allows me to re-run failed tests AND tests, which weren't yet executed when I pressed "STOP"?


Atlassian has the solution for your problem: Clover. But it is commercial.


This goes against the idea of a test suite. Normally you want to run all your tests specifically so you know you haven't broken anything somewhere unexpected. If you change the code and then run a subset of the tests, the possibility exists that you broke something and one of the skipped tests would have failed. This is a case of not getting your cake and eating it too.

If you find a bug in an early test, by all means stop the suite. Fix the bug but then run the suite from the beginning.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜