Coder Social home page Coder Social logo

teamcity-dotcover's Introduction

dotCover intergation with

NuGet TeamCity.dotCover License

Provides the TeamCity integration with dotCover via the Visual Studio Test Platform. This package is an alternative way to run .NET tests under dotCover described in this post.

Supported SDK

  • .NET Core SDK 2.0+

Supported platforms

Supported OS

  • Windows

Usage scenarios

In brief, you can create a test project and run tests collecting code coverage statistics in 3 lines:

dotnet new mstest
dotnet add package TeamCity.dotCover
dotnet test

where mstest is the one of dotnet project templates.

The command dotnet add package TeamCity.dotCover adds the TeamCity integration with dotCover by referencing the TeamCity dotCover integration package.

The final test project might look like the following:

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

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
    <PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
    <PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
    <PackageReference Include="TeamCity.dotCover" Version="2019.1.1" />    
  </ItemGroup>  
</Project>

To run tests under dotCover use the .NET CLI plugin for TeamCity or any other TeamCity runners which allow running a command equivalent to:

dotnet test

or

dotnet msbuild /t:VSTest

Passing dotCover arguments

If you want to specify any argument you’ve used previously with dotCover, you can do this by simply adding the environment variable starting by TC_DC_ prefix to the variable name.

E.g., to specify an assembly filters, use the environment variable TC-DC_Filters instead of --Filters:

SET TC_DC_Filters=-:MyTests

Diganostics

To gather diagnostics information use the environment variable TC_DC_TRACE_FILE and specify path to a trace file there. For instance:

SET TC_DC_TRACE_FILE=c:\temp\trace.txt

Important notes

  • Avoid specifying code coverage options in runners because the TeamCity dotCover integration package already runs your tests under dotCover.
  • The gathering of code coverage statistics is turned off when tests are not running under TeamCity (for instance when tests are running locally).

teamcity-dotcover's People

Contributors

nikolaypianikov avatar mkjetbrains avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.