TeamCity.VSTest.TestAdapter
1.0.9
See the version list below for details.
dotnet add package TeamCity.VSTest.TestAdapter --version 1.0.9
NuGet\Install-Package TeamCity.VSTest.TestAdapter -Version 1.0.9
<PackageReference Include="TeamCity.VSTest.TestAdapter" Version="1.0.9" />
paket add TeamCity.VSTest.TestAdapter --version 1.0.9
#r "nuget: TeamCity.VSTest.TestAdapter, 1.0.9"
// Install TeamCity.VSTest.TestAdapter as a Cake Addin #addin nuget:?package=TeamCity.VSTest.TestAdapter&version=1.0.9 // Install TeamCity.VSTest.TestAdapter as a Cake Tool #tool nuget:?package=TeamCity.VSTest.TestAdapter&version=1.0.9
Test Adapter for <img src="https://cdn.worldvectorlogo.com/logos/teamcity.svg" height="20" align="center"/>
<img src="http://jb.gg/badges/official.svg"/> <img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:TeamCityPluginsByJetBrains_TeamCityVSTestTestAdapter_Build)/statusIcon.svg"/>
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
⚠️ tests might not be reported correctly for .NET Core xunit test projects when logging verbosity levels is
minimal
orquiet
because of issue, so try avoiding using these verbosity levelsdotnet 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 Support
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
Product | Versions 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. |
-
.NETFramework 3.5
- Microsoft.TestPlatform.ObjectModel (>= 11.0.0)
- TeamCity.ServiceMessages (>= 3.0.10)
-
.NETFramework 4.0
- Microsoft.TestPlatform.ObjectModel (>= 11.0.0)
- TeamCity.ServiceMessages (>= 3.0.10)
-
.NETStandard 1.5
- Microsoft.TestPlatform.ObjectModel (>= 15.0.0)
- NETStandard.Library (>= 1.6.1)
- TeamCity.ServiceMessages (>= 3.0.10)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on TeamCity.VSTest.TestAdapter:
Package | Downloads |
---|---|
2GIS.NuClear.BuildTools
Инструменты автоматизации |
|
Octopus.Server.Extensibility.Tests
Provides test infrastructure for Octopus Server extensions/modules. |
GitHub repositories (6)
Showing the top 5 popular GitHub repositories that depend on TeamCity.VSTest.TestAdapter:
Repository | Stars |
---|---|
bchavez/Bogus
:card_index: A simple fake data generator for C#, F#, and VB.NET. Based on and ported from the famed faker.js.
|
|
stride3d/stride
Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
|
|
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
|
Version | Downloads | Last updated |
---|---|---|
1.0.41 | 20,272 | 10/1/2024 |
1.0.40 | 688,986 | 2/22/2024 |
1.0.39 | 273,630 | 12/18/2023 |
1.0.38 | 290,975 | 10/17/2023 |
1.0.37 | 223,164 | 8/24/2023 |
1.0.36 | 2,688,407 | 3/2/2022 |
1.0.35 | 61,372 | 2/25/2022 |
1.0.34 | 268,241 | 2/3/2022 |
1.0.33 | 47,118 | 2/1/2022 |
1.0.32 | 243,805 | 12/23/2021 |
1.0.31 | 35,134 | 12/20/2021 |
1.0.30 | 115,571 | 12/10/2021 |
1.0.29 | 48,532 | 12/2/2021 |
1.0.28 | 85,929 | 11/17/2021 |
1.0.27 | 410,474 | 9/18/2021 |
1.0.26 | 1,180,418 | 7/13/2021 |
1.0.25 | 752,707 | 2/16/2021 |
1.0.23 | 882,588 | 11/11/2020 |
1.0.22 | 555,890 | 7/10/2020 |
1.0.21 | 650,778 | 4/29/2020 |
1.0.20 | 438,962 | 2/6/2020 |
1.0.18 | 153,660 | 12/26/2019 |
1.0.17 | 434,415 | 9/27/2019 |
1.0.15 | 2,058,575 | 4/3/2019 |
1.0.14 | 182,294 | 2/5/2019 |
1.0.13 | 163,552 | 12/12/2018 |
1.0.12 | 96,820 | 10/31/2018 |
1.0.11 | 92,987 | 10/5/2018 |
1.0.10 | 235,249 | 7/10/2018 |
1.0.9 | 84,809 | 6/5/2018 |
1.0.8 | 108,534 | 4/11/2018 |
1.0.7 | 220,313 | 12/18/2017 |
1.0.6 | 53,040 | 11/14/2017 |
1.0.5 | 60,739 | 10/19/2017 |