How to integrate dotcover and Jenkins
Asked Answered
S

1

10

How to integrate dotcover and Jenkis.

Any PDF or Guide?

I was able to run the dot cover through command line and it generate test results. However when I try to run in Jenkins through windows batch command it throws an error as

Command 'cover' doesn't support 2 unnamed arguments Type 'dotCover help' for usage.

Anything missing?

Shantel answered 30/6, 2014 at 7:10 Comment(2)
I have exactly the same Problem, any progress?Bois
This page contains detailed descriptions about the dotcover.exe command:Ben
I
10

I use dotCover from Jenkins. I have multiple DLL's that need testing, so my job will execute dotcover for each DLL, merge the test snapshots, and generate a HTML report. My Jenkins setup includes "HTML Publisher plugin" and "NUnit plugin"

First grab the command line tools and put it on the Jenkins server: dotCoverCommandLineTools

Run the command line tool in a windows batch command:

windows batch command to run tests

I had little luck trying to pass params into the command line, so I used the settings xml from dotCover (contents of dotCoverTRAEngineTest.xml):

    <?xml version="1.0" encoding="utf-8"?>
    <CoverageParams>
      <TargetExecutable>C:\NUnit-2.6.3\bin\nunit-console.exe</TargetExecutable>
<TargetArguments>C:\Jenkins\workspace\TRA.CodeCoverage\TRAEngine\TRAEngineTest\bin\x64\RduDev\TRAEngineTest.dll /xml:C:\Jenkins\workspace\TRA.CodeCoverage\TestReports\dotCoverTRAEngineTestRESULTS.xml</TargetArguments>
        <TargetWorkingDir></TargetWorkingDir>
      <Output>TRAEngineTestSnapshot.dcvr</Output>
    </CoverageParams>

Paths on the Jenkins server are hard coded because I'm lazy. I know it should be a parameter somehow but it's working for now.

Next I merge all the snapshots: merge

Contents of merge xml:

<?xml version="1.0" encoding="utf-8"?>
<MergeParams>
  <Source>TRAUnitTests.dcvr</Source>
  <Source>TRAEngineTestSnapshot.dcvr</Source>          
  <Output>MergedSnapshots.dcvr</Output>
</MergeParams>

Then run the report: report

Contents of report.xml:

<?xml version="1.0" encoding="utf-8"?>
<ReportParams>
  <Source>MergedSnapshots.dcvr</Source>
  <Output>CoverageReport.html</Output>
  <ReportType>HTML</ReportType>
</ReportParams>

All the .xml files above reside in a folder named "TestReports", and that's where I output all the results to. Jenkins will look there to publish the HTML report and nunit results: results publish

When it all works right you should get the dotCover report and the nunit results on the job page.

Illeetvilaine answered 28/3, 2016 at 17:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.