0

I configured xunit parser task under my project's Bamboo plan, I ran my plan: Starting task 'Xunit' of type 'com.wwwlicious.xunit.xunit:xunitParser' Failing task since test cases were expected but none were found.

It dawns on my xunit parser only parses test result produced somehow from prev steps?

I tried to add a script task to run xunit tests manually: 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

So, okay - I can configure a Bamboo Script task to run "dotnet test", it'd produce SomeApplTests.xml under "TestResult" folder. Now the challenge is: how to feed it to xunit parser? Also trx logger also no good, prolly need xunit logger https://github.com/spekt/xunit.testlogger

Thanks

References:
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

user3761555
  • 851
  • 10
  • 21

1 Answers1

0

Answer is found:

You need install in test project "XunitXmlTestLogger" (https://github.com/spekt/xunit.testlogger) Then configure a Script task: dotnet test -l:"xunit;LogFileName=Test.xml" You need set Working Directory to point at your test project, for example: MySoln\MyTestProj

Then configure your xUnit.net Parser task in Bamboo, with xUnit Test Results File/Directory to point at: MySoln\MyTestProj*.xml (Default is: artifacts/**/*.xml)

https://github.com/wwwlicious/wwwlicious.bamboo.xunit/issues/6

user3761555
  • 851
  • 10
  • 21