Integrating with Jenkins using SmartRunner with Coverage report
For testing with SmartRunner you need to get Build Server license. See here. License should be Complete for getting Coverage.
If you want to see Coverage Summary table in project as in the upper screenshot,
you need add plugin OpenCover
that depends from Code Coverage API
(Jenkins/Manage Jenkins/Manage Plugins/Available/..)
If you want to see detailed Coverage pages for classes and methods
(that are clickable too) in project as in the upper screenshot, you need add HTML Publisher plugin
1. In Jenkins CI, under Build, Add Build Step.
2. Select Execute windows Batch Command.
3. In the Command field, add the following command to run SmartRunner:
<location>/TypeMock.SmartRunner.Console.exe -t <location>/SomeTests.dll <location>/AnotherTests.dll -o TestResults -k CompanyName "LicenseCode"
4. You also should add next parameters to command above if you want to see Coverage:
-c <location>/CoverageAssembly.dll --CoverageReportTypes=Html,Xml --CoverageOutput=coverage
5. For Coverage Summary table add another task Publish Coverage Report choose OpenCover and point yours Report file path as TestResults/coverage.xml
6. For detailed Coverage HTML add another task Publish HTML reports
and fill fields:
HTML directory to archive as ./TestResults/coverage
Index page[s] as index.htm
Report title as Project Coverage HTML or what you preffer
7. Click Save.