0
votes

I have this build : Build setup It works fine. The only issue is that the Test Results are overridden. So I actually end up with the test results for the last test project executed. This is executed by build engine;

C:\Program Files\dotnet\dotnet.exe test C:/agent/_work/4/s/test/Services.UnitTests/project.json --configuration release -xml ./TEST-tle.xml

C:\Program Files\dotnet\dotnet.exe test C:/agent/_work/4/s/test/Web.UnitTests/project.json --configuration release -xml ./TEST-tle.xml

What could help: 1) having "dotnet test" generate XML output file - did not find a way how to do that 2) Use a variable for -xml output file in Build Task. That variable could be a random string/number or just a project name being tested - like what Build engine feeds to "dotnet.exe test". No way how to do that.

Any ideas? Thanks.

2

2 Answers

1
votes

I think that, although you're running the task against all of the projects in one go, as the .Net Core (Preview) task doesn't have a working directory, that the test results are being generated at solution root (or similar) and done for each project in turn.

I set mine up using simple command line tasks...

Tool: dotnet

Arguments: test -xml testresults.xml

Working folder: {insert the folder for the project to test here}

These work fine but I have one set up for each project. You could try creating a task for each library and adding the full path to the test results argument (or name them appropriately as starain suggested).

This feels like a minor bug to me.

0
votes

Based on my test, it doesn’t recognize the date variable as Build Number.

To deal with this issue, you can add another .Net Core (Test) step to run xunit test with different result file.

For example:

enter image description here enter image description here