Dashing widget to display test coverage.
The widget is based on JenkinsBuild, which shows you a completion percentage while Jenkins builds the project and zero in other cases. Actually, if you think about it, build takes only a small amount of time (of course, if your project is not building for half an hour). So we decided to find a more reasonable use of this state and show percentage of test coverage.
In our company, we try to cover most of our projects, so for us it is very helpful!
The Dashing job fetches JENKINS_URI/job/#{job_name}/ws/coverage/index.html and trying to get test coverage percentage for this project. At this point it is able to recognize the results of RCov or SimpleCov. If you're using something else, you just have to tell the job where to look for the percentage in html file (see test_coverage.rb
for details).
- Install TestCoverage widget
The files test_coverage.coffee
, test_coverage.html
and test_coverage.scss
go in the /widget/test_coverage
directory.
The test_coverage.rb
goes in the /jobs
directory.
Otherwise you can install this plugin typing:
dashing install GIST_ID
-
Change the JENKINS_URI to your correct uri for Jenkins, eg.:
JENKINS_URI = URI.parse("http://ci.yourserver.com")
-
Put all the jobnames and pre job names in the
config/jenkins_jobs.yml
. -
Add the following block to your dashingboard.erb file:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="my_app" data-view="TestCoverage" data-title="My App" data-min="0" data-max="100"></div>
</li>