collate Jenkins build artifacts to make another html report - jenkins

I have approx 50 Jenkins job running HP Performance center script twice a day, which archives Performance center report that it gets from remote PC server. I am able to send these individual reports on emails but I would like to consolidate all these reports. Getting the status of these tests by reading html would be a better option. Is there a way I can achieve this
http://localhost:8080/job/Test_Sanity/job/Test_Sanity/38//artifact/performanceTestsReports/pcRun106540/Report.html

You might have to zip the reports manually and use extended email plugin to attach the same.
(Note: Extended email plugin can attach only with in the workspace , so you might have to move your zip file to workspace)

Related

Unable to generate cucumber reports in jenkins. net.masterthought.cucumber.ValidationException: None report file was added

I am using jenkins to run jobs that uses maven with cucumber . my jobs are running succesfully. I have also managed the plugin Cucumber report in jenkins. But when i view the report i am getting the message as shown in below picture.
I have tried to install various plugins like Jenkins plugin, standalone but with no joy. These are shown as options in the bottom right of the report.
Any clue is helpful. I have tried to check this error in stackover flow also. I didnt get any clue
I could see the reports file in xml which is created by surefire plugin. Any way i can achive reporting part in my project
I managed to get reports in jenkins now.
Previously Jenkins is unable to find the json file in my project.
I have set the path of json file as target and i could able to see the reports.
This might help for those who are looking for answer.
#CucumberOptions(
features= "C:\\Users\\dd pc\\workspace\\PracticeCucumber\\src\\main\\java\\com\\qa\\feature\\Test.feature",
glue= {"com\\qa\\stepDefinition"},
format= {"pretty","html:test-output_1",
"json:target/cucumber-reports/CucumberTestReport.json"},
plugin = ("json:target/cucumber-reports/CucumberTestReport.json"),
monochrome= true,
dryRun= false
)
I am able to solve by providing **/*.json
under Post-build Actions/Cucumber Report/JSON Report Location/ File Include Pattern = **/*.json
First of all in runner file we need to provide following plugin as follows: plugin= {"json:target/cucumber.json" }
Now in Jenkins job, in "post build" section during configuration, add cucumber reports, click on advanced option and provide 'target' text in "JSON Reports Path" text field. Save the job, it will run and will work fine.
Note: target text is the name of folder which we have provided in runner file for generating reports in Json, also cucumber report plugin works on json so need to generate report in json.
I my case the problem was in two jobs over the same test repository (one for Chrome one for Firefox), where one deletes report files after the job while second job was already running and vice versa.

How do I get a list of jobs with longest build time in Jenkins

I need to generate a weekly report on our Jenkins build cluster. One of the reports is to display a list of jobs that have the longest build time.
The solution I can come up with is to parse the "Build history" page on each slave (also master) and for each build of a job, parse the build page and look for "Took x min x sec on slave-xx".
This feels quite cumbersome, does anyone know a better solution using Jenkins API or Groovy script console?
Thanks
You can get the build data for your report through the Jenkins API. For a given job, you can
retrieve the list of builds with duration information using something like:
http://jenkins:8080/job/my-job/api/json?tree=builds[id,number,duration,timestamp,builtOn]
To see a list of all the API-available build data for a given job:
http://jenkins:8080/job/my-job/api/json?tree=builds[*]
Once you have a query that retrieves the job information that you need for
your report, it should be straightforward to loop over the jobs.
Most Jenkins pages have a link at the bottom to the REST API that describes a bit about accessing the API for that page, e.g. http://jenkins:8080/job/my-job/api.
How about using plugins?
Check this out:
https://wiki.jenkins-ci.org/display/JENKINS/build-metrics-plugin
There are few others too which you can try depending on how much customization/features you want to do/display:
https://wiki.jenkins-ci.org/display/JENKINS/Global+Build+Stats+Plugin - This is quite extensive
https://wiki.jenkins-ci.org/display/JENKINS/Project+Statistics+Plugin
https://wiki.jenkins-ci.org/display/JENKINS/eXtreme+Feedback+Panel+Plugin

How to email reports created by ReportNG using Jenkins?

How to email the reports created by ReportNG using Jenkins?
I have done ReportNG set-up which is perfectly giving the reports to me and I have integrated my suite with Jenkins. But I don't know how to send the reports created by ReportNg as mail via Jenkins. Because, only if we have the entire html folder, the ReportNG works and able to see html report since there are dependencies in the ReportNG so I have to zip and send the entire html folder to see the perfect result.
Note : I am using Emailable-Ext plugin in Jenkins.
You can get the report links from your jenkins server where the reports are saved. And just email the link to the stakeholders, instead of emailing entire report.
Also, you can try jenkins plugins to automatically move the reports to some other machine/directory for future purpose (if needed) and email the links.

Need help getting artifact names out of Jenkins for email

I have three Jenkins projects (Maven jobs, to be exact) that have many available parameters. I've set up a way to automate running these weekly with a set of parameters using the Build Flow plugin so that I end up running a total of 12 builds. I also have a follow-up project that exists only to send an email containing some information about the builds that ran, including a link to all 12 of the artifacts.
My problem is figuring out a way to get the artifact names from all 12 jobs. I think the best way to do that is using the REST API, but I could use some help with that.
I am using the Editable Email Notification plugin, and I have access to the job name and build number. I probably just need a script to grab the artifact name from each job.
Does anyone have experience with this?
I haven't tried the exact case you want, but you should be able to use the depth and tree parameters of the REST API to narrow down the data you need. Start with the API URL for one of the builds, which will be of the form
http://jenkins/job/jobname/buildnumber/api/json

How can I get the SVN log entry in Jenkins when sending email

I'm trying to create an automated build at work using Jenkins. We're using SVN for version control. When a build is successful I would like to send an email to my team saying... Person X has committed the following changes.
How can I include the committers name and the last SVN log entry in the body of the email?
I'm using the Jenking email-ext plugin.
Thanks!
Subject line:
To display the committer(s) of the last build, you can put the following into the subject line anywhere you want. Do note that if multiple people have committed since the last build, multiple names will be shown, hence the (space) in "%a ".
${CHANGES, format="%a "}has/have committed the following changes
Or to display a list of culprits that broke the build
Build broken by ${CHANGES_SINCE_LAST_SUCCESS, reverse=true, format="%c", changesFormat="%a "}
Unfortunately, if a culprit's name appears several times in commit messages, it will appear several times in the subject too.
SVN log in the email
To get the SVN log into the email, I use the following:
${CHANGES_SINCE_LAST_SUCCESS, reverse=true, format="<b>Changes for Build #%n</b><br>%c<br>", changesFormat="<br>[<a href='${JENKINS_URL}/user/%a/builds'>%a</a>] - (%r) %p<br> %m<br>"}
This was all pulled together from the Content Token Reference on-page help with lots of trial and error. Scroll to the bottom of your email-ext configuration, and click the ? icon in-line with Content Token Reference text (it may take a while to load)
Produces output similar to:
Changes for Build #123
[commiter_name] - (1234567) /svn/path/to/changed.files
Commit message here

Resources