2

I'm using xunit, with trait attributes set on some of my tests. When running dotnet test I'm trying to filter by these traits. I have it working fine locally on my Windows machine but when I run the same command on my CI container then it doesn't filter my tests.

The command is:

dotnet test --filter Category=Integration

I'm using CircleCI with the container mcr.microsoft.com/dotnet/core/sdk:2.2

When I SSH to the box and try running the command, it just runs all of the tests.

dotnet --info from the container:

.NET Core SDK (reflecting any global.json):
 Version:   2.1.700
 Commit:    c2ef055a0f

Runtime Environment:
 OS Name:     debian
 OS Version:  9
 OS Platform: Linux
 RID:         debian.9-x64
 Base Path:   /usr/share/dotnet/sdk/2.1.700/

Host (useful for support):
  Version: 2.1.11
  Commit:  d6a5616240

.NET Core SDKs installed:
  2.1.700 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.11 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.11 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
halfer
  • 19,824
  • 17
  • 99
  • 186
Matt Keen
  • 329
  • 3
  • 8
  • Just an observation: "mcr.microsoft.com/dotnet/core/sdk: **2.2** " but in the info output, there is only 2.1.11 ... Could that play a role? – Fildor May 23 '19 at 07:55
  • 1
    @Fildor ah yes, i had downgraded the image in an attempt to fix it and put the wrong output in the question. It didn't resolve the issue though. I'm now thinking it's something to do with the version of vstest as that's the main difference between my windows machine and the image – Matt Keen May 23 '19 at 19:19

1 Answers1

1

I've managed to resolve my issue just about. It appears it's a bug with the 16.1.0 SDK version (which dictates the version of vstest). As the issue was just on CI for me, I pinned the container I was using to

mcr.microsoft.com/dotnet/core/sdk@sha256:d0a71e1312be2618f320a7b7cc6d7423af3810542b3ffd35438108800ecfb958

which contains the 16.0.1 SDK. It's not the perfect fix but resolves my immediate issue.

Matt Keen
  • 329
  • 3
  • 8