题
我们目前正在为我们的构建使用JUnit 4.4和Ant 1.7.1。我有一些@Ignore
d的测试用例。当我在Eclipse中运行它们时,JUnit测试运行器将它们报告为忽略。我希望看到它们列在Ant的XML输出中(所以我可以报告它们),但它们似乎并不存在。
有没有人有这个工作?是否有开关打开它们?我需要升级吗?
解决方案
看起来这是一个已知的 Ant问题/错误。
其他提示
这个线程讨论了同样的问题,但是它提供了一些额外的信息:你可以在使用maven surefire运行测试时获得被忽略测试的数据,而hudson能够显示这些数据。
http ://jenkins.361315.n4.nabble.com/Is-it-possible-to-show-Ignore-JUnit-tests-td1565288.html
刚刚尝试使用JUnit 4.11的Ant 1.9.0。如果您使用<junit printsummary="on">
,您将获得如下输出:
[junit] Running com.example.IgnoredTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.01
[junit] Running com.example.PassingTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01
[junit] Running com.example.FailingTest
[junit] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.01
我认为如果我们可以使用printsummary=off
:
[junit] Test com.example.IgnoredTest SKIPPED
[junit] Test com.example.FailingTest FAILED
但似乎上面更详细的输出是我们能做的最好的,除非我错过了一个 junit任务参数。
不隶属于 StackOverflow