【问题标题】:Bamboo: How to run xunit tests (Script task), then feed it to "xunit parser"Bamboo:如何运行 xunit 测试(脚本任务),然后将其提供给“xunit 解析器”
【发布时间】:2019-02-15 11:23:40
【问题描述】:

我在项目的 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 loggerhttps://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
How to publish results using dotnet test command

https://github.com/spekt/xunit.testlogger

【问题讨论】:

    标签: bamboo xunit.net


    【解决方案1】:

    找到答案:

    您需要安装在测试项目 "XunitXmlTestLogger" (https://github.com/spekt/xunit.testlogger) 然后配置一个Script任务: 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-20
      • 2018-01-12
      • 1970-01-01
      相关资源
      最近更新 更多