过滤 JUnit 文件中的错误/失败的最佳方法是什么?
我的部门使用持续集成,但我们的产品和流程不太适合应立即修复错误的模型(运行时间长、共享资源、旧的 VCS 工具等)。不过,CI 对于快速检测问题并识别罪魁祸首仍然很有用。我有一个脚本可以读取 JUnit XML 文件并确定过滤哪些失败并写入新的过滤输出文件,但我想在文件中包含可以在 CI 工具中看到的信息,解释为什么它被过滤。不幸的是,测试用例和测试套件元素似乎缺少节点。格式中是否有地方可以放置此信息?
<testsuites>
<testsuite name="name">
<testcase name="name">
<failure>some message</failure>
</testcase>
</testsuite>
</testsuites>
变成这样的东西:
<testsuites>
<testsuite name="name">
<testcase name="name">
<failure>some message
Filtered: See bug #####</failure>
</testcase>
</testsuite>
</testsuites>
My division uses continuous integration but our product and process don't lend well to the model that bugs should be fixed immediately (long runtimes, shared resources, old VCS tools, etc). CI is still useful for detecting problems quickly and identifying the culprits though. I have a script which can read the JUnit XML file and determine which failures to filter and write a new filtered output file but I'd like to include information in the file which can be seen in CI tools which explains why it was filtered. Unfortunately, the testcase and testsuite elements seem to lack a node. Is there a place in the format where I can place this information?
<testsuites>
<testsuite name="name">
<testcase name="name">
<failure>some message</failure>
</testcase>
</testsuite>
</testsuites>
Into something like:
<testsuites>
<testsuite name="name">
<testcase name="name">
<failure>some message
Filtered: See bug #####</failure>
</testcase>
</testsuite>
</testsuites>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以简单地修改测试。如果当前代码将
其更改为
您也可以向断言...方法添加消息。使用
而不是
You can simply modify the test. If the current code is
change it to
You can add a message to assert... methods, too. Use
instead of