I have just released Task::Jenkins 0.05 to CPAN (meta).
This is a feature release and it now included Devel::Cover::Report::Clover which is a report formatter for Devel::Cover, which can generate Clover reports consumable Devel::Cover reports in Jenkins using the Clover Plugin.
The configuration of the plugin is pretty basic:
We specify where we want the report to be and in our actually integration test step we add the following:
#create Devel::Cover report
#create clover report from Devel::Cover using #Devel::Cover::Report::Clover
./cover -report clover -outputdir clover
In addition I generate the HTML reports and these are then accessible via clicking the graphical coverage report (please see my Wiki page on Continuous Integration for Perl using Jenkins).
#create html report from Devel::Cover::Report::Html
./cover -report html -outputdir clover && \
mv clover/coverage.html clover/index.html
This reports already exist since they are generated by Devel::Cover by default so perhaps a copy of these from cover_db can be done, but this was the first shot – or is strikes me I could just tell the clover report generation to output to
cover_db/ – this has to be tried out.
The rename of coverage.html to index.html is however unavoidable AFAIK to support the integration with the plugin.
This is really swell, BUT WAIT there is more…
This next part is not currently a part of Task::Jenkins, but I do mention it in the POD distributed with Task::Jenkins from this release and it might go in in the future. It was pointed out to be that a Jenkins plugin exists to visualize Perl::Critic reports, it is called Violations (thanks mil for the tips on plugins).
It is somewhat more tricky to set up. Lets start with the configuration:
You start by pointing to perlcritic.txt, this file should contain output from a Perl::Critic run.
The plugin simply parses output from Perl::Critic. So you have to add a step to generate this file, which should contain something a long the lines of this:
./perlcritic –brutal –verbose 5 –profile \
t/perlcriticrc lib t > perlcritic.txt
I run with the highest severity since I just want a report of everything. I point to the perlcritic resource file following the distribution (also under version control), but I overwrite severity using –brutal and output format using the verbosity flag.
It is quite important to output in format 4 or 5 since only these are supported by the plugin. I normally prefer format 8 since it makes it easy to copy-paste the policy name into a perlcriticrc file.
With format five you get also the filenames and you redirect it into the text file.
Then you will get the following graph for you build.
And when you click the graph you get the following detailed view:
You can see violations, violations by severity, trends and by clicking the filenames you get even more in-depth information.
My Wiki page on Continuous Integration for Perl using Jenkins will be updated soon with all of these findings and other tips and goodies.
Please let me know if you experience issues or have other tips I could benefit from.
Continued happy integration!
This blog acts as a channel for communicating logicLAB’s open source activities. Announcements on open source initiatives, involvements and releases of open source distributions of software products, projects and applications.