I had the opportunity to play with Jenkins again last week. And the setup for our projects went pretty smooth. But the fact that no matter what i tried. The clover forecast icon would always show up as rainy . While the build was succeeding without issues. So i spend some time googling and trying out multiple “fixes”. Of which none seemed to actually work. I even reverted back to using the Jenkins clover plugins instead of Clover for PHP. No difference at all.
It seemed as if the settings from the config page were completely ignored when calculating the clover status. This was really bugging me. So i checked out the clover plugin source from github. And browsed through the code for a while. When i found the beauty below inside CoverageTarget.java
So it seems as if somewhere in the plugin it’s actually calculating the average of the coverage per setting. The strange thing in the method above however is the elementCoverage setting. Which is not available in the Jenkins config interface. And causes issues because we have no influence over this setting.
So i added the setting to the config manually
$ vi /var/lib/jenkins/jobs/[project]/config.xml