TeamCity dotnet vstest integration

Answered

Hi,

We are using TeamCity 2021.2.2 (build 99660). 

We are trying to integrate the test results from "dotnet vstest" command but with no luck. There seem to be some dated plugins, and some other solutions that either don't work or sound overly complicated for something that should seemingly work out of the box.
So maybe we're doing something wrong? Maybe there's a viable working solution out there that I can't find?

The setup is following: 

- We have .NET Core 3.1 test library runit xUnit framework + playwright.

- We have the TeamCity.VSTest.TestAdapter package installed in the test project.

- TeamCity has a Command Line build step (somehow we didn't manage to get it to work via any other xUnit runner or whatnot)

- The build step is essentially: dotnet vstest path-to-dll 


The tests are running and showing output in the console, but TeamCity doesn't parse the results as actualy tests with history, failed/succeeded, etc., like it would do with nunit for instance. 

What are we doing wrong?

0
1 comment

Well, that's embarassing, but I've managed to finally get it to work a few minutes after posting this.

The Command Line had to be extended with a couple of flags: /Logger:teamcity /TestAdapterPath:.

Now the test results are being collected! 

1

Please sign in to leave a comment.