有没有合并 NUnit 结果文件的工具?
由于不清楚的原因,我的 Nunit 测试装置无法在单次运行中执行,因此我被迫在单独的运行中执行一些测试。然而,这意味着测试结果被分割到多个输出文件中。
是否有可用的工具可以将 NUnit 结果 XML 文件合并到单个 XML 文件中?
我尝试过使用现有的 Nunit-summary 工具,但这只是按顺序解析带有给定 XSL 文件的 XML 文件,并将结果连接为一个大文件。
相反,我希望它首先将测试用例的结果合并/分组到正确的命名空间/测试装置中,然后将其提供给 XSLT 处理器。这样,所有测试结果都应该通过夹具显示,即使它们不是在单次运行中收集的。
For unclear reasons my Nunit test fixture cannot be executed in a single run, so I'm forced to execute a few tests in separate runs. However this means that the test results are splitted over multiple output files.
Is there a tool available which can merge NUnit result XML files into a single XML file?
I've tried using the existing Nunit-summary tool, but this simply sequentially parses the XML files with the given XSL file and concatenates the result as one big file.
Instead I would like it to merge/group the results for the test cases into the right namespaces/testfixtures first and then feed it to the XSLT processor. This way all test results should be displayed by fixture even though they're not gathered in a single run.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能已经太晚了,无法帮助您,但我们最近遇到了类似的问题,并编写了一个小型开源工具来帮助您: https://github.com/15below/NUnitMerger
从自述文件中:
在 MSBuild 中使用
加载任务:
在目标中为其提供文件数组:
在 OutputPath 中查找生成的组合结果。
在 F# 中使用
创建一个 F# 控制台应用程序并添加 15below.NUnitMerger.dll、System.Xml 和 System.Xml.Linq 作为引用。
This is probably too late to help you, but we recently encountered a similar issue and wrote a small open source tool to help out: https://github.com/15below/NUnitMerger
From the readme:
Using in MSBuild
Load the task:
Feed it an array of files with in a target:
Find the resulting combined results at OutputPath.
Using in F#
Create an F# console app and add 15below.NUnitMerger.dll, System.Xml and System.Xml.Linq as references.
我使用上面的 15below NUnitMerger 一段时间,但想扩展它,由于我的 F# 技能还不够好,所以我检查了它们的机制并在 C# 中实现了以下类来实现同样的事情。这是我的起始代码,它可能会帮助任何也想在 C# 中进行此类操作的人:
I was using the 15below NUnitMerger above for a while, but wanted to extend it and since my F# skills are not good enough to do it there, I inspected their mechanism and implemented the following class in C# to achieve the same thing. Here is my starting code which might help anyone who also want to do this kind of manipulation in C#:
我在网上读到 Nunit 结果文件是 XML,所以我想你可以使用普通的合并软件(如 WinMerge)合并该文件
I read on the web that Nunit result files are XML so i guess you can merge the file with an ordinary merge software as WinMerge