Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to adjust Jenkins weather report for clover coverage on PHP projects

I have a few PHP projects installed for a new team in Jenkins, and I'm trying to lower the expectations initially to help ramp them up on testing and everything. Initially we're shooting for 20% code coverage. I've adjusted the bounds in my PHPUnit config file to go green on code coverage when they hit 20% - so they can see they're heading in the right direction. but what I'm trying to do is update the weather report in my jenkins views to reflect the clover coverage as well, and I can't seem to do that!

Jenkins Weather Report Clover Coverage

I have the Publish Clover PHP Coverage Report checked in my jenkins project configuration, and my clover.xml is being generated from PHPUnit, but I'm not sure how to adjust the bounds for this.

logging from phpunit.xml.dist:

<logging>
  <log type="coverage-html" target="build/coverage" title="ERC"
     charset="UTF-8" yui="true" highlight="true"
     lowUpperBound="10" highLowerBound="20"/>
  <log type="coverage-clover" target="build/logs/clover.xml"/>
  <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>

Project settings coverage metrics

I initially didn't have the Publish Html Report enabled, but I've found that enabling it and modifying the percentages never had any affect after I saved and re-ran the build. enter image description here

like image 939
veilig Avatar asked Apr 23 '12 12:04

veilig


1 Answers

The bounds for the Jenkins weather report are defined in Jenkins and not in phpunit

enter image description here

It might look a little different for you depending on whether you use the Clover or the CloverPHP plugin but it's in the Jenkins settings page ether way :)

like image 57
edorian Avatar answered Oct 04 '22 20:10

edorian