NCoverReporting tasks exits with error code 3

NCoverReporting tasks exits with error code 3

I have applied minimum coverage to the project. If the project does not meet the limits it fails with error code 3 and not any informative information about what went wrong.

I have previously reported this problem in version 2.x which can be found at http://www.ncover.com/forum/show_topic?id=692

Using version 3.4.12.6869


RE: NCoverReporting tasks exits with error code 3

Hi, bsundsbo,

Thanks for checking back with us about this. When you apply //mc, you should see something that shows why it failed--something like this:

/***

The following elements failed to meet minimum coverage requirements: ( Metric: value, Minimum: value )

x items failed to meet the minimum coverage requirements.

NCover.Reporting failed with exit code '3'.

***/

Are you saying that you're only seeing the last part of that message? At this point, NCover does not show which parts of the test failed minimum coverage, only that it did fail and the failed value. To view the data, you'll need to open the coverage file in NCover Explorer, or share an html report with your team that shows details on sections that did not meet a coverage standard.

You can also use //sct to set a threshold, which is the same as a //mc, except that the //sct threshold appears as a line the trend graph that you create.

Does that answer your question? If you are having trouble seeing the rest of the message that should display in the console, please send me a note at support@ncover.com and we'll handle it from there.

Thanks for using NCover!


RE: NCoverReporting tasks exits with error code 3

I am using TeamCity as my build server, and the console is not available.

However, if I use detailed log output, the following message appears in the build log.

Which is more informative than "exited with code 3", but it is still tedious to find.

These messages had a priority of High in the MSBuild task, it should at least display on the first page so it is more accessible to the developer.

Having more control with how we can integrate with TeamCity would be great, such as fail the build, but not stop us from publishing reports.

This might have been fixed in TC 5, but we have not yet found the time to upgrade.


RE: NCoverReporting tasks exits with error code 3

Thanks for the note, bsundsbo. Yeah, I agree that things could be a little different for TeamCity 4 display options. Have you tried suggesting this to the folks at TeamCity as well? For TeamCity 5, you can easily pass messages back to TeamCity via their service messages. We have some excellent documentation on this at http://docs.ncover.com/how-to/continuous-integration/teamcity/.


RE: NCoverReporting tasks exits with error code 3

Thanks. I had a brief look at that document a few days ago. However, my initial feature request for NCover and the NCoverReporting MSBuild task is to print out more information about what actually failed to meet minimum coverage, and perhaps print it with a higher message priority.

Then I can look into displaying this information in TC, be it version 4.5 or 5.x.

I would also be interested in being able to get the return code into a property in MSBuild so I can perform aditional tasks (like archive and publish the coverage report) before failing the build. In other words tell the task "I want you to inform me if you fail, but I wish to fail the build manually".


RE: NCoverReporting tasks exits with error code 3

bsundsbo,

Thanks for the feedback! I've let our development team know about your request. Please keep them coming. Our user community is a big reason for NCover being so great.