如何以 junit 格式记录 dotnet 测试输出
dotnet test
默认使用 trx 输出。我正在使用 trx2junit 将其转换为 junit,但这会使 CI 设置变得复杂。
是否可以直接从 dotnet test 输出 junit 格式的测试报告?
dotnet test
uses trx output by default. I am using trx2junit to convert it to junit, but this complicates CI setup.
Is it possible to output test report in junit format directly from dotnet test?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将 NuGet 包安装到您的测试项目:
运行以下命令以 JUnit XML 格式输出测试结果:
更多信息请参见:
Install the NuGet package to your test project:
Run the following command to output the test results in JUnit XML format:
More info here:
这将创建测试结果文件位于
执行测试
要将结果文件命名为不同的,请使用 ie
dotnet test --logger:"junit;LogFileName=my-test-results.xml"
dotnet add package JUnitXml.TestLogger
dotnet test --logger:junit
This will create the test result file in
<csproj-dir>\TestResults\TestResults.xml
To name the result file different, execute the test with i.e.
dotnet test --logger:"junit;LogFileName=my-test-results.xml"
有人知道如何在可以通过此命令枚举的系统上安装 junit 记录器(如果可能吗?)?
我发现需要在 csproj 上安装软件包非常糟糕
anyone knows how to install junit logger (if it is possible ?) on system that can be enumerated via this command ?
I find the need to install package on csproj quite crappy