Display Code Coverage on Overview Page
I'm wondering if it is possible to somehow display the code coverage % on successful builds. We are currently using dotCover.
When a build fails, it shows a message like this:
Tests passed: 365; percentage of statement coverage 99.456 is 0.544 less than the provided threshold…
When it succeeds, it shows this:
develop #170 Tests passed: 378
What I'd like it to show when it succeeds is this:
develop #170 Tests passed: 378; percentage of statement coverage is 54.12
This is all in efforts to slowly bring awareness to our code base's code coverage at a glance, so that we can begin to start putting in metrics on some of our other solutions.
|
Any ideas on how to make this happen? |
Please sign in to leave a comment.
Hi, and sorry for the delay.
Posting the message result for the build is delegated to the specific runner, so the first thing is that you would need to check which runner you are using for that. There is a way to affect the build result message, described here: https://confluence.jetbrains.com/display/TCD10/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingBuildStatus
What you could do if the runner doesn't do it automatically is either add a last build step that takes the dotcover reports and parses them to retrieve the code coverage, then post it by yourself, or create your own build runner that posts it automatically.
Example
It should be possible to change the build status more easily, testing this was slow, the method is also brittle.