1 Replies Last post: Apr 16, 2014 10:20 PM by Fedor Buyvol-Kot  
David Porter Newbie 1 posts since
Apr 7, 2014
Currently Being Moderated

Apr 7, 2014 11:04 PM

Fail TeamCity build if tests do not cover lines in change set

I work on a project with a code base that is not well covered by tests and where large parts of it are slowly changing. Rather than just looking for a high level coverage metric to slowly decrease over time, it would be helpful to be more targeted by verifying that any lines of code affected by a particular change are covered by tests. Being able to fail the build if this verify step failed would be useful in keeping us honest in writing a test around assumptions of the affected old code before changing it / verify new assumptions are met.

 

TeamCity seems capable at some level of understanding which files and lines within those files are changed as part of a build, at least as part of diff view of the change set, and dotCover integration is capable of highlighting which rows are covered and whether tests pass / fail... so surely it is but a simple step to combine those two bits of information to give a coverage metric just for changed lines and ability to fail the build if not 100% (respecting explicit exclusions).

 

Of course, this may already be possible and if only I'd RTFM in depth I would be asking. Assuming it's not, any chance of this as a feature or as a TeamCity plugin?

Fedor Buyvol-Kot JetBrains 94 posts since
Dec 9, 2011
Currently Being Moderated
Apr 16, 2014 10:20 PM in response to: David Porter
Re: Fail TeamCity build if tests do not cover lines in change set

Hi David,

 

Currently this scenario is not possible, but it's a viable suggestion. Here's a corresponding feature request: http://youtrack.jetbrains.com/issue/TW-36057

You are welcome to vote for it and track its status.

 

Regards.

More Like This

  • Retrieving data ...