I am aware that there is already a similar question here, but I think my problem is sufficiently different to warrant creating a new post.
I use CAKE 0.21.1.0.
As a build step on TeamCity, I am executing build.ps1
, which in turn invokes build.cake
. In the build.cake
script, I have added a task called RunTests
, which uses the VS Test Runner to execute my unit tests.
Currently, whenever there are failed tests, all I see is Exit code 1
on the TeamCity main page:
When I navigate to view the build log itself, I see more details about the failed tests:
In the screenshot above, I have highlighted the text output that I would like to display on the TeamCity main page as part of the project's summary, instead of Exit code 1
.
How can I capture the VS Test Runner output, so that I can include it as part of my build script's interaction with TeamCity?
UPDATE:
Thank you @mholo65 for his reply! I tried the first approach that he outlined, but unfortunately it did not work for me.
I modified my build.cake
script to include these lines:
VSTest("./**/bin/Release/CakeTest.dll", new VSTestSettings() { Logger = "trx"} );
TeamCity.ImportData("vstest", "./TestResults/*.trx");
When running the tests on my TeamCity build agent, this is my working/checkout directory:
And this is the full path to my results file:
However, this is still what I see on the TeamCity main page, instead of the VSTest output Total tests: 5. Passed: 3. Failed: 2. Skipped: 0.
: