Create custom metric

Hello
I am trying to write a plugin that will use some custom tools for counting code coverage. One of features, that I would like it to have is possibility of failing build if coverage droped. Ofc TC has this option already, but can it support custom metrics with it? If yes: how do I emit value of this metric for TC to know it? If not: ist there way around it, so I can still somehow fail the build?
Thanks in advance
Regards
Kamil

4 comments
Comment actions Permalink

Ok, so I found out this one out. For further reference:
there is class jetbrains.buildServer.serverSide.BuildMetric that you can extend and it works

0
Comment actions Permalink

Hi Kamil,

Sorry for the not replying in time and thank you for the update. FYI, I filed a corresponding issue to document the API.

BTW, Can you share what coverage tool you write support for? Is this something which can be useful for outher users?

0
Comment actions Permalink

Hi Yegor
Thanks for creating the issue. I am workig on OpenCover support and didn't yet considered if it will be possible to use it with other tools..  You can track development of what I am working on here: https://github.com/mindriven/TeamCity-OpenCoverRunner.

0
Comment actions Permalink

Hi Kamil,

Thank you for hte update.

Seems to be nice addition to the bundled dotCover tool. Please let us know when the plugin is ready for use so that we can add it to the plugins page.

BTW, you can probably report the coverage statistic values with the same names as the bundled coverage (see the list). This way metrics for them (in build failure conditions) should be available automatically.

0

Please sign in to leave a comment.