Jenkins cucumber reports to show on main job's page - jenkins

I run cucumber tests as part of a continuous integration for one of my products. I use the Jenkins cucumber-reports plug-in.
It all works well and is very useful!
I'd like to be able to show the reports on the main Jenkins job's page and not under an inner page in the job.
Does anyone have an idea on this?

Have you tried Dashboard View plugin? I have been using it for monthes and I used it to customize my jenkin's Homepage. It give you the ability to add any portlet into your jenkins Homepage. This is how my jenkins Homepage looks like after I started to use this Dashboard View plugin. I am not sure if it support cucumber report or not but at least you can have a try.

Related

Jenkins Dashboard view to show multiple Cucumber Reports

Background: we have like ~50 Jenkins jobs (and more to come) executing Cucumber scenarios and generating and posting reports using Cucumber Reports Plugin.
Problem: Cucumber reports can be inspected only one by one; I mean, we have to go through all the jobs and to check the relevant reports.
Question: Is there an already existing solution to create a Jenkins Dashboard View and to put there all the reports (column view, matrix view, whatever)? I tried Dashboard View plugin, but does not support Cucumber reports. Radiator View Plugin did not fix my problem either. I would like to have a single dashboard view and to see all the Cucumber reports for the added test execution jobs.
I had the same problem. I could not find anything. I solved it by writing a simple app that combed the cucumber-reports directories and read the cucumber-trends.json files.
I then output this to an html page that I landed in userContent.
Whole process took about a day, less time than I spent looking for a pre-made solution...

Jenkins plugin - how to create multiple pages for displaying report

I'm developing a Jenkins plugin for displaying reports of my own tool. I got difficulties because Jenkins lacks documentation for developing plugins. Currently, my plugin can only display report on a build page
Screenshoot (surroneded by red border):
http://imgur.com/a/5WvsA
But I want multi-page reports like the Junit plugins on this video:
https://www.youtube.com/watch?v=lWw9AQqUAGU&t=174s (2:56)
How to make a Jenkins plugin that can display reports on multiple pages?
If you want to go through the JUnit Plugin code below is the starting point to dig into it.
TestResultAction
Refer the below link for an article for you to start.
jenkins-plugin-development
I have accomplished this by utilizing ANT build scripts which generate HTML report files after running all of my JUnits.
You could simply publish JUnit results (represented in HTML files) to a public_html directory on a web server which can then be accessed via web browser, displayed on Jenkins dashboards via iframe, etc
Just add this plugin and publish the JUnit results.

Have Jenkins read the first column from a table in Confluence

I have to do a server-deployment on a weekly base which i am trying to automate as much as possible. Right now i am stuck, because i get some information from my companies confluence page where a few scripts are listed ordered by version.
As i already have some automation going in jenkins i wanted to try to get jenkins to read from this confluence page and have it execute e.g. all scripts from the 3.5.2 version in a step.
Can i somehow get information out of confluence with jenkins? Right now i do this manually every time. Any help is greatly appreciated!
Create a script in jenkins
Do a wget call in your jenkins script to call the confluence REST API to get the content of your page
Use jq to parse the content that comes back from confluence.
Parse the field you want and get the scripts you want
If you're feeling happy, you can even update your confluence page and say that your jenkins job ### ran these scripts.
I have created a blog on something similar:
http://javamemento.blogspot.no/2016/05/jira-confluence-3.html
There is some code in github too, if you're interested.

Is it possible to show all the submits from a Perforce depot without having to select a job?

We are currently attempting to setup an instance of Jenkins as our build system for our code base. We have multiple jobs setup (all using the same depot) to build different sections of the code.
We would now like to show the submits from all users pertaining to this depot on the main Jenkins screen rather than being able to view the change lists involved with a certain build (e.g. by selecting a certain job and then the link leading to the build information, etc...). I've looked into possible plugins and the closest one I was able to find was the "All Changes Plugin". This is exactly what we would like, but this is only visible when viewing the details of a build (e.g. which CLs were used to create the build), but would it be possible to show this type of information on the main Jenkins page instead?
Thank you in advance for your help.
You could write an extension for the Dashboard View plugin to provide a portlet containing an aggregated list of changes from perforce, though if you aren't experienced with writing plugins then you might be better off using a separate repository browser such as Fisheye or P4Web to display your changes.

Jenkins: Display last console output on project page

When viewing a project in Jenkins, I'd like to see the last console output displayed on the project page.
This satisfies two needs:
I most often just want to see what the output of the build was; clicking through to the last console output seems needlessly cumbersome
Non-technical management can't remember how to / aren't sufficiently motivated to click through to the last console output in cases where the output is relevant to them if only they were to easily see it
I've looked for plugins that support this but can't find any.
What options do I have?
First an easy solution: job descriptions (push 'edit description' button on the main job page) admit HREF links. Make that link your latest build console permalink (http://[jenkins_server]/job/[job-name]/lastBuild/console).
If even one click is too much, here's a possible solution: you can use log contents as the description of your job. You can update your job via Jenkins CLI with:
java -jar jenkins-cli.jar -s http://[jenkins-server] update-job [job-name] < config.xml
So what you need to do is this: after your jobs run, trigger another job that will take the triggering job and console output file as parameters, substitute <description> in the job's config.xml with the contents of the console file (with proper escaping, etc.), and run the update command as above. Of course, this solution is labor-intensive and bug-prone.
I had this same questions myself and I ended up finding this option useful...
http://[jenkins-server]/job/[job-name]/[build-number|lastBuild]/logText/progressiveText?start=0
Edit: This no longer works in the current version of Jenkins
Similar to malenkiy_scot's answer, you can actually embed iframes in the description.
I use:
<iframe src='lastBuild/consoleText' style='width: 80%; height: 500px'></iframe>
as my project description, and it shows the latest console text in the project description page.
I just created a plugin that displays console output of latest build at the project page.
https://github.com/jenkinsci/display-console-output-plugin
To use this plugin, you have to type mvn hpi:hpi to create a display-console-output.hpi file. Then upload this plugin from http://localhost:8080/pluginManager/advanced.
You can simply just use one of these plugins:
http://wiki.hudson-ci.org/display/HUDSON/Hudson+Personal+View
https://wiki.jenkins-ci.org/display/JENKINS/Console+Column+Plugin
May be you don't need it, you can click in the status button in the left of each build, each button show console output for each build.
Of course, this feature may not be operative in all Jenkins versions.
The solution for your problem is the https://wiki.jenkins-ci.org/display/JENKINS/Extra+Columns+Plugin plugin for Jenkins. After installing it you may modify your view to add a button for the console output as an additional column.
For a declarative pipeline, you can show a link to the console right where the progress bar shows up by adding this line at the very top of the file:
currentBuild.description = """Job console"""
This depends on a plugin and a setting, both of which were already on my system:
The OWASP Markup Formatter plugin provides the setting Security > Configure Global Security > Markup Formatter, which should be set to "Safe HTML".
The setting Jenkins -> Manage Jenkins -> Configure System -> Jenkins Location -> Jenkins URL needs to be the URL of your Jenkins installation.

Resources