How to publish dotnet core tests with jenkins pipeline? How to publish dotnet core tests with jenkins pipeline? jenkins jenkins

How to publish dotnet core tests with jenkins pipeline?


I managed to do so using the "MSTestPublisher" class,

So the final pipeline is:

node {stage 'Checkout'    checkout scmstage 'Build'    bat "\"C:/Program Files/dotnet/dotnet.exe\" restore \"${workspace}/MyProg.sln\""    bat "\"C:/Program Files/dotnet/dotnet.exe\" build \"${workspace}/MyProg.sln\""stage 'UnitTests'    bat returnStatus: true, script: "\"C:/Program Files/dotnet/dotnet.exe\" test \"${workspace}/MyProg.sln\" --logger \"trx;LogFileName=unit_tests.xml\" --no-build"    step([$class: 'MSTestPublisher', testResultsFile:"**/unit_tests.xml", failOnError: true, keepLongStdio: true])}