bamboo - Bamboo:如何运行 xunit 测试(脚本任务),然后将其提供给“xunit 解析器”
问题描述
我在项目的 Bamboo 计划下配置了 xunit 解析器任务,我运行了我的计划:启动类型为 'com.wwwlicious.xunit.xunit:xunitParser' 的任务 'Xunit' 失败的任务,因为预期有测试用例,但没有找到。
我的xunit解析器只解析从上一步以某种方式产生的测试结果?
我尝试添加一个脚本任务来手动运行 xunit 测试:https ://xunit.github.io/docs/getting-started/netcore/cmdline
C:\SomeApplication>dotnet test -l:trx;LogFileName=SomeApplTests.xml
Build completed.
Test run for C:\SomeApplication\bin\Debug\netcoreapp2.0\YI.LS.Test.dll(.NETCoreApp,Version=v2.0)
Microsoft (R) Test Execution Command Line Tool Version 15.9.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Total tests: 20. Passed: 20. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 4.3114 Seconds
所以,好吧 - 我可以配置一个 Bamboo脚本任务来运行“dotnet test”,它会在“ TestResult ”文件夹下生成 SomeApplTests.xml 。现在的挑战是:如何将它提供给xunit 解析器?另外 trx logger 也不好,prolly 需要 xunit logger https://github.com/spekt/xunit.testlogger
谢谢
参考:
https ://marketplace.atlassian.com/apps/1216522/xunit-net-parser?hosting=server&tab=support
https://github.com/wwwlicious/wwwlicious.bamboo.xunit/issues/6
如何发布结果使用 dotnet 测试命令
解决方案
找到答案:
您需要安装在测试项目“XunitXmlTestLogger”(https://github.com/spekt/xunit.testlogger)然后配置脚本任务: dotnet test -l:"xunit;LogFileName=Test.xml" 您需要将工作目录设置为指向您的测试项目,例如:MySoln\MyTestProj
然后在 Bamboo 中配置您的 xUnit.net Parser 任务,将 xUnit 测试结果文件/目录指向:MySoln\MyTestProj*.xml(默认为:artifacts/**/*.xml)
https://github.com/wwwlicious/wwwlicious.bamboo.xunit/issues/6
推荐阅读
- javascript - 检查后表达式发生了变化 - 角度
- java - 从jacoco和pit生成PDF文件
- java - 带有嵌套片段的过渡会产生明显的滞后而不是平滑过渡,如何平滑这种过渡?
- boost-spirit-x3 - Spirit X3 中序列的位置注释
- android - 使用 WRAP_CONTENT 时 TextView ShadowLayer 被裁剪
- svg - 如何在 jekyll markdown 中嵌入 SVG 代码(在 Github 上)?
- python - 不理解这个“AttributeError:'module'对象没有属性”,即使它是在之前导入的
- python - 如何在烧瓶应用程序中重定向默认网址
- docker - 来自 Docker 运行命令的环境变量未传递到 .NET Core 控制台应用程序
- jquery - 防止移动浏览器中的 jQuery .on 点击事件