[GRADLE-1518] Build should fail immediately once test failure is detected Created: 09/May/11  Updated: 02/Feb/17  Resolved: 02/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: New Feature
Reporter: Ildiko Varga Robey Assignee: Unassigned
Resolution: Duplicate Votes: 43


 Description   

Build does not stop immediately after a test failure is detected. It would be nice to be able to specify a flag to stop build immediately after a test has failed.

We use the Test task for longer running integration and acceptance testing. In these cases I would like to fail the build fast (right after the first test failure is detected).



 Comments   
Comment by Qiao Zhao [ 04/Mar/13 ]

That will be helpful for debug purpose. I need similar functionality as well to debug some fragile test which only failed when you run all tests in a batch.

Comment by Hans Loven [ 06/Feb/15 ]

This is a serious limitation of gradle, and a reason that I would not likely choose it in future projects. Please assign to someone asap. Thx.

Comment by vantchev [ 04/May/15 ]

This will be a really helpful feature for longer integration test runs.

Comment by Soahc [ 23/Jul/15 ]

yes this would be really helpful, because our integration test suit run takes up to one hour and it would really nice to get the information earlyer that there are any failing tests

Comment by Raidex [ 29/Aug/16 ]

+1 – very helpful to have this. This thread: http://bit.ly/2bufkos describes an attempt using TestListener.afterTest to no avail. Any suggestions on API to actually stop the runner and fail the build? Thanks.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Sebastian Schuberth [ 15/Nov/16 ]

I'm still interested in an option to fail the build early if any test fails as that would allow developers to get quicker feedback from CI systems.

Comment by Benjamin Muschko [ 02/Feb/17 ]

The feature is now tracked on GitHub: https://github.com/gradle/gradle/issues/1310

Generated at Wed Jun 30 11:57:32 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.