TeamCity.VSTest.TestAdapter 1.0.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package TeamCity.VSTest.TestAdapter --version 1.0.8
NuGet\Install-Package TeamCity.VSTest.TestAdapter -Version 1.0.8
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TeamCity.VSTest.TestAdapter --version 1.0.8
#r "nuget: TeamCity.VSTest.TestAdapter, 1.0.8"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TeamCity.VSTest.TestAdapter as a Cake Addin
#addin nuget:?package=TeamCity.VSTest.TestAdapter&version=1.0.8

// Install TeamCity.VSTest.TestAdapter as a Cake Tool
#tool nuget:?package=TeamCity.VSTest.TestAdapter&version=1.0.8

<img src="http://jb.gg/badges/official.svg" height="20" align="center"/> Test Adapter for <img src="https://cdn.worldvectorlogo.com/logos/teamcity.svg" height="20" align="center"/>

<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:TeamCityPluginsByJetBrains_TeamCityVSTestTestAdapter_Build)/statusIcon.svg"/> <img src="https://www.nuget.org/Content/Logos/nugetlogo.png" height="18">

Provides the TeamCity integration with test frameworks via the Visual Studio Test Platform or VSTest IDE tools.

<img src="https://github.com/JetBrains/TeamCity.VSTest.TestAdapter/blob/master/Samples/MS.Tests/Docs/NewTest.gif"/>

Supported platforms:

  • Visual Studio Test Platform
  • VSTest Console version 12+

Visual Studio Test Platform

Presently, Visual Studio has an open and extensible test platform with tests written using various test frameworks and run using a variety of adapters. The Test Platform, from its vantage, resolves the lifecycle of the test into a series of stages – two of which are writing and running the test – with the goal of providing extensibility at each stage.

For each test project:

  • Add a NuGet reference to the Visual Studio Test Platform.

    dotnet add package Microsoft.NET.Test.Sdk
    
  • Add NuGet references to NuGet packages of the selected test framework and coresponding test adapter which supports Visual Studio Test Platform. For example:

    dotnet add package MSTest.TestFramework   
    dotnet add package MSTest.TestAdapter
    
    dotnet add package xunit   
    dotnet add package xunit.runner.visualstudio
    
    dotnet add package NUnit   
    dotnet add package NUnit3TestAdapter
    
    dotnet add package DevTeam.TestFramework   
    dotnet add package DevTeam.TestAdapter
    

    or others.

Alternatively to two steps above, you could create the a test project from the command line using the specified template:

dotnet new mstest

or

dotnet new xunit
  • To support the TeamCity integration add a NuGet reference to the TeamCity Test Adapter to turn on the TeamCity integration.

    dotnet add package TeamCity.VSTest.TestAdapter
    

Thus, the final project file could look like the following:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>    
    <TargetFrameworks>net45;netcoreapp1.0;netcoreapp2.0</TargetFrameworks>    
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
    <PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
    <PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
    <PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.6" />    
  </ItemGroup>  
</Project>

VSTest Console

  • To support the TeamCity integration, add a NuGet reference to the TeamCity Test Adapter

  • To run tests from the command line, use additional command line arguments: /TestAdapterPath:., /Logger:teamcity

    • The first argument points to the path where the runner can find the assembly of the TeamCity logger (the directory of the testing aseembly).

    • The second argument points to the TeamCity service messages logger.

For example:

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" dotNet.XUnit.Tests.dll /Logger:teamcity /TestAdapterPath:.

VSTest extensions

  • Download the custom logger

  • Extract the contents of the downloaded archive on the agent machine:

    • for VisualStudio 2017 update 5 onwards - to PROGRAM_FILES(x86)\Microsoft Visual Studio\2017<Edition>\Common7\IDE\Extensions\TestPlatform\Extensions

    • for VisualStudio 2017 till update 4 - to PROGRAM_FILES(x86)\Microsoft Visual Studio\2017<Edition>\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions

    • for VisualStudio 2015 - to PROGRAM_FILES\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions

    • for VisualStudio 2013 - to PROGRAM_FILES\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions

    • for VisualStudio 2012 - to PROGRAM_FILES\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Extensions

  • Check that the custom logger was installed correctly by executing vstest.console.exe /ListLoggers in the console on the agent machine. If the logger was installed correctly, you will see the logger with FriendlyName TeamCity listed: TeamCity.VSTest.TestLogger.TeamCityTestLogger URI: logger://teamcity

See more details in the Wiki.

See the article for details on how to create tests using the Visual Studio Test Platform.

DOCKER CONTAINER

To run tests from within a Docker container that is hosted on a machine running the TeamCity agent, the container must have an environment variable set to a/any value. Example...

ENV TEAMCITY_PROJECT_NAME=My Project
RUN dotnet test

License

It is under the Apache License.

Contributors

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp1.0 is compatible.  netcoreapp1.1 was computed.  netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Framework net35 is compatible.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on TeamCity.VSTest.TestAdapter:

Package Downloads
2GIS.NuClear.BuildTools

Инструменты автоматизации

Octopus.Server.Extensibility.Tests The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Provides test infrastructure for Octopus Server extensions/modules.

GitHub repositories (5)

Showing the top 5 popular GitHub repositories that depend on TeamCity.VSTest.TestAdapter:

Repository Stars
stride3d/stride
Stride Game Engine (formerly Xenko)
nuke-build/nuke
🏗 The AKEless Build System for C#/.NET
JetBrains/rd
Reactive Distributed communication framework for .NET, Kotlin, C++. Inspired by Rider IDE.
neo4j/neo4j-dotnet-driver
Neo4j Bolt driver for .NET
dradovic/MigSharp
Mig# (MigSharp) is a .NET framework for database migrations and versioning
Version Downloads Last updated
1.0.40 91,808 2/22/2024
1.0.39 168,208 12/18/2023
1.0.38 236,466 10/17/2023
1.0.37 200,608 8/24/2023
1.0.36 2,366,095 3/2/2022
1.0.35 57,579 2/25/2022
1.0.34 256,423 2/3/2022
1.0.33 42,759 2/1/2022
1.0.32 223,960 12/23/2021
1.0.31 33,028 12/20/2021
1.0.30 106,651 12/10/2021
1.0.29 44,727 12/2/2021
1.0.28 78,636 11/17/2021
1.0.27 393,719 9/18/2021
1.0.26 1,165,679 7/13/2021
1.0.25 716,303 2/16/2021
1.0.23 829,129 11/11/2020
1.0.22 540,889 7/10/2020
1.0.21 620,646 4/29/2020
1.0.20 414,708 2/6/2020
1.0.18 144,661 12/26/2019
1.0.17 402,023 9/27/2019
1.0.15 2,005,630 4/3/2019
1.0.14 175,501 2/5/2019
1.0.13 149,090 12/12/2018
1.0.12 91,722 10/31/2018
1.0.11 88,551 10/5/2018
1.0.10 226,514 7/10/2018
1.0.9 77,749 6/5/2018
1.0.8 105,198 4/11/2018
1.0.7 199,257 12/18/2017
1.0.6 49,701 11/14/2017
1.0.5 57,524 10/19/2017