JetBrains / TeamCity.VSTest.TestAdapter

Apache License 2.0
30 stars 14 forks source link

.net 5 support #42

Closed bill-robbins-ss closed 3 years ago

bill-robbins-ss commented 3 years ago

This package does not copy TeamCity.VSTest.TestAdapter.dll and TeamCity.VSTest.TestLogger.dll when the project is using net5.0.

Note that IoC.dll and TeamCity.ServiceMessages.dll are copied.

As a workaround, I extracted the two files and added them to my project in dependencies\ then copy them using MSBuild.

  <ItemGroup>
    <DependencyFiles Include="$(ProjectDir)\dependencies\*.dll"/>
  </ItemGroup>

  <Target Name="CopyDependencies" BeforeTargets="PreBuildEvent">
    <Copy
        SourceFiles="@(DependencyFiles)"
        DestinationFolder="$(TargetDir)"/>
  </Target>
NikolayPianikov commented 3 years ago

@bill-robbins-ss how did you create your test project. I am trying to reproduce:

md tests
pushd tests
dotnet new globaljson --sdk-version 5.0
dotnet new xunit
dotnet add package TeamCity.VSTest.TestAdapter
set TEAMCITY_PROJECT_NAME=Tests
dotnet test
popd
bill-robbins-ss commented 3 years ago

🤔 I didn't RTFM enough. There is a handful of indirection between my project's tests in docker-compose and TeamCity running them, so I was not passing through all of those environment variables.

dotnet test -l teamcity
Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'teamcity'.