AWS CodeBuild-如果junit5 beforeall未经治疗的例外,如何显示错误测试类?
如果junit5 beforeall
如下所示,那么AWS代码构建将无法显示故障测试类。
class ApiImplTest {
@BeforeAll
public static void beforeClass() {
...
throw new RuntimeException("Dummy test error");
}
@Test
void testApi() {
...
}
}
AWS代码构建报告如下所示,如
surefire XML报告显示的错误如下,
<testcase name="" classname="com.master.apis.analytics.ApiImplTest" time="0.002">
<error type="java.lang.RuntimeException"><![CDATA[java.lang.RuntimeException: Dummy test error
at com.master.apis.analytics.ApiImplTest.beforeClass(ApiImplTest.java:46)
]]></error>
我想是由于testcase name =“”
在上面的XML报告中。
有人可以让我知道有没有办法在AWS代码构建测试报告中显示失败的测试类名称?
- Maven Surefire -3.0.0 -m5
- OpenJDK 11
- Junit -Jupiter -5.6.3
If there is an unhandled exception from JUnit5 BeforeAll
like below then AWS Code Build is not able to show the failure test classes.
class ApiImplTest {
@BeforeAll
public static void beforeClass() {
...
throw new RuntimeException("Dummy test error");
}
@Test
void testApi() {
...
}
}
AWS Code Build Report is showing like below
surefire xml report is showing the error like below
<testcase name="" classname="com.master.apis.analytics.ApiImplTest" time="0.002">
<error type="java.lang.RuntimeException"><![CDATA[java.lang.RuntimeException: Dummy test error
at com.master.apis.analytics.ApiImplTest.beforeClass(ApiImplTest.java:46)
]]></error>
I guess it is due to the testcase name=""
in the above xml report.
Can someone let me know is there a way to show the failed test class name in the AWS Code Build test report?
- Maven Surefire - 3.0.0-M5
- OpenJDK 11
- Junit-Jupiter - 5.6.3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论