teamcity-dotnet-plugin icon indicating copy to clipboard operation
teamcity-dotnet-plugin copied to clipboard

.NET Cli output both TeamCity test messages and TRX file for SonarQube.

Open GrayPockets opened this issue 4 years ago • 3 comments

When using the dotnet .CLI, we can't use a parameter like "--logger trx;LogFileName=results.trx" to output a test result file (for eventual pickup via SonarQube).

Please provide a way to output a test file.

GrayPockets avatar May 14 '20 15:05 GrayPockets

I tried using "--logger trx;LogFileName=results.trx" too. Why is this not working in Teamcity? I need the reports to hand them to sonarqube - is there another way to do this?

joergsesterhenn avatar Jan 07 '21 17:01 joergsesterhenn

@joergsesterhenn When I reviewed my logs, I came to the understanding that the dotnet .CLI runner pipes the results into a specialized logger that disallows any other loggers so that it can send the results to TeamCity.

As a work-around I had to switch to command line to create the file for SonarQube and use the "XML Report Processing" build feature to import the unit test results back into TeamCity.

GrayPockets avatar Jan 07 '21 18:01 GrayPockets

Thanks, will try this too.

joergsesterhenn avatar Jan 07 '21 18:01 joergsesterhenn

Using --logger:trx in command line parameters is now available since TeamCity 2023.05.1 (the commit).

Previously, it can not be done because of https://github.com/microsoft/vstest/issues/2368

Closing the issue for now. Please, feel free to reopen, if you need help

mchechulnikov avatar Nov 06 '23 18:11 mchechulnikov