Skip to content
Alexey Nesterov edited this page Jun 23, 2017 · 14 revisions

Supported Integrations

AppVeyor

  1. Add the following NuGet dependencies to your project nunit-runner (if you using NUnit), opencover, coveralls.net. Sample packages.config:
    <packages>
      <!-- opencover and coveralls.net (just get latest versions) -->
      <package id="coveralls.io" version="1.3.4" />
      <package id="OpenCover" version="4.6.166" />
    
      <!-- for NUnit2-lovers -->
      <package id="NUnit" version="2.6.4" targetFramework="net45" />
      <package id="NUnit.Runners" version="2.6.4" />
    </packages>
  2. Write your unit tests
  3. Register at https://coveralls.io/ and point to your GitHub project
  4. Coveralls will the tell you your secret token like repo_token: PlKcHlYUjBpsvFEzSnScYzMDseJi9ASNx
  5. Do not publish this token, instead encrypt it using https://ci.appveyor.com/tools/encrypt
  6. Add an appveyor.yml to the root of your project. Example configuration:
version: 1.0.{build}

install:
    - nuget restore
    
build:
  project: YOURPROJECT.sln
  verbosity: detailed

environment:
    COVERALLS_REPO_TOKEN:  
       secure: ybaVTwokoDe5aIFj3RF2Aea5999hmNS7zaLNnSSy0tJkaC+3SJ3MpBbeTVZqF3q+
 
after_test: 
# generate report for NUnit testing framework:
    -cmd: packages\OpenCover.4.6.166\tools\OpenCover.Console.exe -register:user -filter:"+[*]*" -target:"packages\NUnit.Runners.2.6.4\tools\nunit-console.exe" -targetargs:"/noshadow /domain:single YOURPROJECT.Tests\bin\debug\YOURPROJECT.Tests.dll" -output:coverage.xml

# generate report for MSTest testing framework:
#    -cmd: packages\OpenCover.4.6.166\tools\OpenCover.Console.exe -register:user -filter:"+[*]*" -target:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe" -targetargs:"/testcontainer:YOURPROJECT.Tests/bin/debug/YOURPROJECT.Tests.dll" -output:coverage.xml
        
    - cmd: packages\coveralls.io.1.3.4\tools\coveralls.net.exe --opencover coverage.xml -r %COVERALLS_REPO_TOKEN%

NUnit 3+

If you are using NUnit3+ with the NuGet packages NUnit.Runners 3+, you'll need to specifically use the NUnit.ConsoleRunner package and nunit3-console.exe executable. Also the /noshadow argument is now invalid with NUnit3 and can be removed as it is the default. after_test changes to:

- cmd:packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -register:user -filter:"+[*]*" -target:"packages\NUnit.ConsoleRunner.3.2.1\tools\nunit3-console.exe" -targetargs:"/domain:single YOURPROJECT.Tests/bin/debug/YOURPROJECT.Tests.dll" -output:coverage.xml

For a more elaborate example look at this project's configuration file appveyor.yml

Jenkins

Clone this wiki locally