有没有一种方法可以“快速失败"?与Maven surefire插件的Junit吗? [英] Is there a way to "fail fast" for junit with the maven surefire plugin?

查看:61
本文介绍了有没有一种方法可以“快速失败"?与Maven surefire插件的Junit吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用maven处理Java项目.在构建过程中,我们使用maven surefire插件来运行junit套件.

I'm currently working on a java project using maven. We use the maven surefire plugin to run our junit suite as part of the build process.

我们的测试套件在覆盖范围和执行时间上都在迅速增长.当您最终等待十分钟才能发现测试在测试的第一分钟失败时,执行时间会非常令人沮丧且耗时.

Our test suite is rapidly growing, in both coverage and execution time. The execution time is very frustrating and time consuming when you end up waiting ten minutes to find out that a test failed in the first minute of testing.

我想找到一种方法,使构建过程在测试套件中的第一个错误/失败时失败.我知道这对于其他构建工具也是可能的,但是我一直无法找到一种使用maven surefire做到这一点的方法.

I would like to find a way to make the build process fail upon the first error/failure in the test suite. I know that this is possible for other build tools, but I have been unable to find a way to do this with maven surefire.

我知道有未解决的问题在surefire jira中可以使用此功能,但是我希望为此有一个现有的解决方案.

I know that there is an unresolved ticket for this functionality in the surefire jira, but I'm hoping that there is an existing solution out there for this.

推荐答案

截至2015年9月6日

As of September 6th 2015 it appears there is, -Dsurefire.skipAfterFailureCount=1.

截至2015年10月19日版本2.19已发布.

As of October 19th 2015 version 2.19 has been released.

这篇关于有没有一种方法可以“快速失败"?与Maven surefire插件的Junit吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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