JetBrains / TeamCity.VSTest.TestAdapter

Apache License 2.0
30 stars 14 forks source link

cant get it to work with nunit #30

Closed garethbudden closed 5 years ago

garethbudden commented 5 years ago

Hi, I'm probably missing something obvious but I was following the animation on your Readme and i can't get the teamcity service messages I was expecting.

These are the commands that I'm running from powershell on my localmachine

> mkdir nunitTest > cd nunitTest > dotnet new nunit > dotnet add package TeamCity.VSTest.TestAdapter > dotnet restore > dotnet test

which outputs

Microsoft (R) Test Execution Command Line Tool Version 15.9.0 Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait...

Total tests: 1. Passed: 1. Failed: 0. Skipped: 0. Test Run Successful. Test execution time: 1.2920 Seconds

As you can see it runs the test ok, but i was expecting the teamcity service messages.

Here's what my csproj looks like

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>

    <IsPackable>false</IsPackable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="nunit" Version="3.11.0" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
    <PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.14" />
  </ItemGroup>

</Project>

Any guidance as to what i'm doing wrong would be great, thank you

NikolayPianikov commented 5 years ago

@garethbudden Logger detects a running under TeamCity to not make a mess in stdOut. To test your commands just set the environment variable TEAMCITY_VERSION to some value. For instance SET TEAMCITY_VERSION=2018.2. TeamCity makes it automatically for each child process

garethbudden commented 5 years ago

ah! brilliant that's got it, thanks.