fandrei / AppMetrics

Apache License 2.0
8 stars 2 forks source link

OpenCover based code coverage reports #92

Closed mrdavidlaing closed 12 years ago

mrdavidlaing commented 12 years ago

Andrei,

I've integrated OpenCover(https://github.com/sawilde/opencover) & ReportGenerator (http://reportgenerator.codeplex.com/) - via their NuGet packages - into the AppMetrics build as a RunTests target.

The result is a set of code covereage reports like:

This technique is self contained - ie, you don't require anything additional installed on the build server for it to run, just what is checked out in the packages/ folder

I propose we use this method to calculate code coverage in the build.

If you are happy, please integrate this into the master branch

fandrei commented 12 years ago

It looks ok to start with, but there is at least one issue. OpenCover shows coverage 0% for GetSessions method, despite we have tests for it. (this method is invoked indirectly via web server) We need find a way to work around this.

mrdavidlaing commented 12 years ago

I suspect its because I'm not running the correct test assembly.

Can you not just add the relevant test assembly to TestAssemblies property group ?

fandrei commented 12 years ago

Aha, that's what I need. But there is another issue - sometimes OpenCover hangs for indefinite time. I'm investigating this.