How to Use Jenkins Reporter Plugin
Today I'll share some tips on how to use a Jenkins plugin called Publish HTML Reports and a tool we made and open-sourced called Jenkins Reporter. Combine these two handy plugins and you get easy-to-grasp test reports for your branches. What more could you want in life?
- Using the Publish HTML Reports Plugin in Jenkins
- Using the Jenkins Reporter Plugin
- Putting the Two Together
- Additional Resources
Using the Publish HTML Reports Plugin in Jenkins
The idea behind the Publish HTML Reports plugin is easy. Once installed you can configure any job to publish and keep some folder from the job's workspace that represents a static webpage. For example, your job might generate a report that has a HTML file that gives you an overview of the test results.
Once you have it configured, your job will get an extra link or many (depending how many reports you publish) in the left menu. That link will always take you to the latest report.
Using the Jenkins Reporter Plugin
We started using Jenkins Views to group all the jobs for a particular VCS branch. At one point, one of our projects had 4 active branches and they each had 20 jobs configured. This started to give me a headache on how to figure out what is the overall status of that branch. If it is not green then what specifically is failing at the moment?
To answer those questions, we wrote a utility called Jenkins Reporter, which goes to a Jenkins View, lists all the jobs and generates a report based on the results. If it finds any failures it will give you all the necessary context needed. It will tell you how many builds have been failing with that failure, and then groups failures based on your matrix settings.
Putting the Two Together
So, we have a tool that generates reports and a plugin that can aggregate and promote those reports. My next thought is how to create a Jenkins job that goes through the views in Jenkins that designate VCS branches and generate a report for each branch? Also, let's make sure that this job runs often enough to keep the reports constantly up to date. What we've got now is a CI system with more high level reports that shows the health of your VCS branches. This is useful for engineers to get an overview of a status of a branch or to a release engineer who might be prepping a release off of a branch that still needs some issues fixed.
Let me know on Twitter @toomasr if you found this useful or have any other tips how to manage large number of jobs in Jenkins while not giving up on higher level reports.
Looking for additional reading on Jenkins?
- Blog - Top 10 Jenkins Plugins and Features
- Blog - Using Jenkins Build Pipelines to Chain and Visualize Jobs
Want more insights? See which tools are most popular in Java today with 2020 Java Developer Productivity Report.