Getting TeamCity dotCover metrics and Karma code coverage metrics working.

I couldn't find anything on this so if I missed the thread on this just point me that way. :)

I am trying to get Karma Code coverage and TeamCity dotCover metrics to work together so if the code coverage is below a certain point, the build will fail.

I found the npm karma-coverage package that will generage the require TeamCity which will generage the needed System messages, but dotCover ignores them and generates its own.

I found this discussion on Stackoverflow on how to use Artifacts:

While this does get me the metrics, it doesn't help me in failing the build if the metrics are below what is expected.

Is there any way to do what dotCover does within Karma code coverage?


1 comment
Comment actions Permalink


You can extract coverage statistics from coverage report and publish statistics values to TeamCity with help of service message. As a result the coverage chart on build configuration Statistics tab will be available and also you'll be able to fail a build with the help of a build failure condition on a metric change.


Please sign in to leave a comment.