Alex Rivera | Logout

maven - fail build when unit test takes too long

Asked 2012-02-16T13:32:44.853
17

I have in my project a lot of unit tests, written in JUnit and TestNG. The building process is based on maven with surefire plugin.

Is there any way/plugin for maven to fail the build when at least one unit test takes too many seconds? I know that there are some plugins to fail build in TeamCity, Jenkins but this is "too far".

In my project I want to have only fast tests to have unit testing process effective. I can improve my old tests but I need to protect for the future commitments

Edit
Report

1 Answer

0

I once had the same requirement, and since I was using TestNG, I used the "group feature".

If you're stuck with JUnit, try using the tests suite (http://stackoverflow.com/questions/817135/grouping-junit-tests)

answered 2012-02-16T13:37:52.573

Your Answer