Merging Execution Data
The Merge command is used to combine coverage executions and their results from the command line.
Note: You can also merge executions automatically by build ID using NCover project settings.
Usage
NCover Merge --project=<project-name>
Options
--project=VALUE NCover project name. *REQUIRED*
--build-id, --buildid[=VALUE]
Specify Build Id for merging executions
--executions[=VALUE] Specify regex pattern to match execution
ids/captions
--source[=VALUE] Specify execution source as part of merge
criteria
--start-time[=VALUE] Specify minimum start time of executions to merge
--consolidate-delete Merge to single execution deleting components
(Cannot be undone!)
--end-time[=VALUE] Specify maximum end time of executions to merge
--each-build Merge all executions based on build Id
--explain[=VALUE] Explain merge results for this Id or Caption
--timeout[=VALUE] Timeout request after number of seconds
--trust-version Allow merging based on assembly file version match
Note: Trust Version is an option that overrides NCover's strict merge criteria and allows coverage data from different modules to be merged, as long as the modules match on file version.
Users must exercise caution in the use of this command. Merging data that doesn't truly match can lead create merged coverage results that are inaccurate.
If the --trust-version argument is not used, NCover will maintain the strict default merge criteria, which require validation of binary equivalence, identical source documents, or identical IL in order to merge.
Sample Command Line Merge by Build ID
You can set the NCover environment variable to assign a build ID to all coverage executions as they are captured.
setx NCOVER_BUILD_ID="MyBuildId"
(Run tests and collect coverage)
ncover merge --project="ProjectName" --buildId="MyBuildId"
When the testing cycle is complete, the Merge command gathers all the completed executions with a matching build ID and creates a single execution.
This command is safe to run repetitively, so that executions for a single regression cycle, which may take days, can be continually merged.