-
Notifications
You must be signed in to change notification settings - Fork 64
NCover Report
Verify minimum code coverage and get more detailed reports for your CI build, through NCover 3's NCover Reporting app.
desc "Check code coverage stats"
ncoverreport :coveragereport => [:build, :coverage] do |cmd|
cmd.command = "path/to/ncoverreport"
cmd.coverage_files = ["path/to/coverage/file"]
cmd.reports = [NCover::FullCoverageReport.new(:output_path => "out")]
cmd.required_coverage = [NCover::BranchCoverage.new(:minimum => 90, :item_type => :Class)]
end
The location of the NCover.Reporting.exe executable.
command = "path/to/ncoverreport"
An array of XML coverage files that were produced by the NCover console task.
coverage_files = ["path/to/coverage/file"]
The reports that you want to run against the specified coverage files: NCover::FullCoverageReport
& NCover::SummaryReport
.
reports = [
NCover::FullCoverageReport.new(:output_path => "out")
]
The path for this report.
:output_path => "out"
The report type: :Html
& :Xml
. This is already set in the concrete report types provided.
:report_type => :Html
The required level of code coverage: NCover::SymbolCoverage
, NCover::BranchCoverage
, NCover::MethodCoverage
, and NCover::CyclomaticComplexity
. Properties may be passed in the constructor as a hash parameter
required_coverage = [
NCover::BranchCoverage.new(:minimum => 90, :item_type => :Class)
NCover::CyclomaticComplexity.new(:maximum => 50, :item_type => :Class)
]
The minimum code coverage to meet or the task will fail, the default is zero (0). Applicable for Symbol, Branch, and Method coverage.
:minimum => 90
The maximum complexity allowed or the task will fail. Applicable only to Cyclomatic Complexity.
:maximum => 50
How the coverage data is aggregated and reported: :View
(default), :Namespace
, :Module
, Class
. Applicable to all coverage types.
:item_type => :Class
Post-coverage exclusions for filtering the coverage results: NCover::AssemblyFilter
, NCover::NamespaceFilter
, NCover::ClassFilter
, NCover::MethodFilter
, & NCover::DocumentFilter
.
filters = [
NCover::AssemblyFilter.new(:filter => "myproject\\*")
]
The text, wildcard pattern, or regex content for the filter.
:filter => "myproject\\*"
The filter type: :exclude
(default), :include
(only in NCover Complete).
:filter_type => :exclude
Tells NCover if the filter data is a regexp: true
or false
(default).
:is_regex => true
(none)