Bamboo:如何运行xunit tests(脚本任务),然后将其提供给“xunit parser”

问题描述 投票:0回答:1

我在我的项目的Bamboo计划下配置了xunit解析器任务,我运行了我的计划:启动任务类型'com.wwwlicious.xunit.xunit:xunitParser'的任务'Xunit'失败任务,因为预期测试用例但没有找到。

它在我的xunit解析器上只是解析了从prev步骤以某种方式产生的测试结果?

我试图添加一个脚本任务来手动运行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 Script任务来运行“dotnet test”,它会在“TestResult”文件夹下生成SomeApplTests.xml。现在面临的挑战是:如何将其提供给xunit解析器?另外trx记录器也没有好处,需要xunit logger https://github.com/spekt/xunit.testlogger

谢谢

参考文献: qazxsw poi qazxsw poi qazxsw poi

https://marketplace.atlassian.com/apps/1216522/xunit-net-parser?hosting=server&tab=support

bamboo xunit.net
1个回答
0
投票

找到答案:

您需要在测试项目中安装“XunitXmlTestLogger”(https://github.com/wwwlicious/wwwlicious.bamboo.xunit/issues/6)然后配置脚本任务:dotnet test -l:“xunit; LogFileName = Test.xml”您需要将工作目录设置为指向测试项目,例如:MySoln \ MyTestProj

然后在Bamboo中配置xUnit.net Parser任务,使用xUnit测试结果文件/目录指向:MySoln \ MyTestProj * .xml(默认为:artifacts / ** / * .xml)

How to publish results using dotnet test command

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.