maven-failsafe-plugin:如何将选项传递给 JUnit?
我使用 maven-failsafe-plugin
来运行我的集成测试。当它失败时,我会看到完整的堆栈跟踪。对于每个失败的测试用例,它可能有大约 50 行,其中大部分与 Junit 相关。我发现 Junit 有 filtertrace
选项,允许剥离堆栈跟踪的一部分,但我不知道如何将此选项传递给 Junit?
我还尝试了 maven-failsafe-plugin
的 trimStackTrace
选项,但它并没有改变失败测试的输出。
是否可以将 filtertrace
选项从插件传递到 Junit? (不使用maven-antrun-plugin
或类似的插件。)
I use maven-failsafe-plugin
to run my integration tests. When it fails, I see full stack trace. For each failed test case it may has about ~50 lines, most of which are related to Junit. I found that Junit has filtertrace
option which allows to strip part of stack trace, but I cannot figure out how to pass this option to Junit?
Also I tried trimStackTrace
option of maven-failsafe-plugin
but it doesn't changed output of failed tests.
Is it possible to pass filtertrace
option from plugin to Junit? (without using maven-antrun-plugin
or similar plugins.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先是您使用哪个版本的故障安全插件和 JUnit?您尝试如何配置trimStackTrace选项,因为trimStackTrace选项默认为true。
您是否尝试过配置 systemPropertiesFile 以将 filtertrace 传递给 JUnit。
The first thing is which version of the failsafe-plugin and JUnit do you use? How did you try to configure the trimStackTrace Option, because the trimStackTrace option is true by default.
Have you tried to configure the systemPropertiesFile to pass the filtertrace to JUnit.
maven-failsafe-plugin
(和maven-surefire-plugin
)包含 当trimStackTrace
对 JUnit 4.x 没有影响时的错误 它在版本 2.13 中修复,所以就我而言,我应该将插件更新到较新的版本。maven-failsafe-plugin
(andmaven-surefire-plugin
) contains bug whentrimStackTrace
has no effect on JUnit 4.x It fixed in version 2.13, so in my case i should update plugin to newer version.