We have set up TeamCity' "failure conditions" to fail build if code coverage metric is bad. The exact condition is to fail build in case code coverage metric has dropped down by several percents.
Sometimes we build a branch which is building for the first time. These are basically release branches. We build them once.
The problem is that TeamCity fails while building new branches. It says, code coverage is bad.
In logs I see that TeamCity cannot find previous build for my branch. Indeed, it needs some previous build to compare code coverage and cannot find it because the branch is new. And as a result it is using some "anchor" branch for comparison.
"Anchor" branch is some old outdated branch which has bigger code coverage. So the evaluation of condition is correct.
The problem is that in case I am building a first build of some branch I expect one of the folowing behaviours:
1. disable code coverage metrics which need previous build which is missing
2. use some meaningfull "anchor" build to compare with, not some outdated build selected by some unclear to me way.
How can I fix it?