How to run and publish .NETCore Xunit tests on VSTS (Vs2017)?

There were two build steps in VSTS:

  • To run tests (VSTS cmd task): DOTNET test -xml TEST-results.xml
  • Publish test results (task of publishing VSTS test): format = XUnit and file name from the previous step

But after upgrading to VS2017, the -XML tag no longer works. I changed the first step to use this: test --logger "trx; LogFileName = TEST-results.xml"

but the second step causes the error "Invalid result file. Verify that the" Test result format "field in the task matches the file result format"

Is there any other way to run .NetCore tests on VSTS? or am i doing something wrong?

Thanks,

+6
source share
3 answers

Change the "Format of the test result" to the step / task of the result "VSTest of Publish Test", it reads the result file correctly.

+3
source

The answer to starain-MSFT will work if you do not want / need xunit tests to be registered with the xunit logger. In this case, you need to do two things.

<PackageReference Include="xunitxml.testlogger" Version="1.0.2-pre-rtm" />

  1. VSTS dotnet : dotnet test -a:. -l:xunit
    -a:., , CLI V15.0, 15.1, ( ). VS2017 15,0, -a:. VSTS. -l:xunit , , , , , , ( xunit trx)

-l , , , github vstest , nuget-, , , , . , , , .

, , , , - TestResults.xml

+4

dotnet xunit dotnet test. . .NET Core.

+2

Source: https://habr.com/ru/post/1016450/


All Articles