sbt/sbt

JUnit XML report contains wrong stacktrace/message when running in forked mode

Open

#1,469 创建于 2014年7月28日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)Scala (4,928 star) (1,036 fork)batch import
Bugarea/test_frameworkhelp wanted

描述

@francisdb reported this bug as https://github.com/sbt/junit-interface/issues/55

However, I think this is actually an SBT bug given that JUnitXmlReportPlugin lives here

This is what is reported in the junit xml reports

sbt.ForkMain$ForkError
    at com.xxx.ServerTest.testInjectingRawData(ServerTest.java:573)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

But the actual failing test stacktrace looks like this

[error] Test com.xxx.ServerTest.testInjectingRawData failed: java.lang.NullPointerException: null, took 0.118 sec
[error]     at com.xxx.ServerTest.testInjectingRawData(ServerTest.java:573)
[error]     ...

贡献者指南