有没有办法“快速失败"?对于带有 maven surefire 插件的 junit? [英] Is there a way to "fail fast" for junit with the maven surefire plugin?

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

问题描述

我目前正在使用 maven 开发一个 java 项目.作为构建过程的一部分,我们使用 maven surefire 插件来运行我们的 junit 套件.

我们的测试套件在覆盖率和执行时间方面都在快速增长.当您在测试的第一分钟内等待十分钟才发现测试失败时,执行时间非常令人沮丧和耗时.

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

我知道有 解决方案

截至 2015 年 9 月 6 日 似乎有-Dsurefire.skipAfterFailureCount=1.>

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

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.

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.

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.

解决方案

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

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

这篇关于有没有办法“快速失败"?对于带有 maven surefire 插件的 junit?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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