We utilize our Jenkins environment to run various tests and jobs daily. Recently we have noticed some instability in our environment - I want to document our passed/failed tests cases that are outputted in the console output. I want to search thru the console output to pull specific tests or script names and have the jobs associated with those tests show up.
Using the Jenkins build history search tool, I'm only able to search thru the job title (name), property & value page (page you see after go into that job). My question: can you search through the console output via the jenkins build history tool?
Thanks in advance
Related
I configured a job on Jenkins which trigger some script in python and does some tests. In the end, it gives results inside an artifact folder (so we can keep X amount of results at any time), which I am showing presenting with a Publish rich text message post-build action. Here is the pretty straight forward code:
<br/>
<h2>Results:</h2>
<iframe src=./artifact/artifacts/results.html width=1100 height=1000></iframe>
This works correctly inside a job build, but if you go inside the main page of the job, I get a 404 not found since it cannot find the file. I understand that the error is correct, since it cannot find any artifact folder if we are not within a build of the said job. My question is how can I have different settings depending if we are inside the main page of the job vs a build of the job ?
I checked online and found that there is a lastSuccessfulBuild variable I can use but then I think it will show the same results no matter which build we are, which is something I do not want.
We run CI tests via Jenkins and review the results via Jenkin's Console Output. If one of the tests doesn't pass, it is printed to the Console in red. Nevertheless, the output is very long and it is tedious to search the entire log to find instances of red output. Are there any good solutions to the issue?
For instance, Gerrit's user interface displays file diffs and a user can use keyboard shortcuts n or p to jump to the next/previous diff block. Is there any such solution/plugin... for Jenkins?
There's the Collapsing Console Sections Plugin:
This plugin allows the creation of sections in build consoles.These sections can be individually collapsed to hide unimportant details. A floating outline widget is available to navigate through all the sections of a build.
and the Console Parser Plugin:
The console parser plugin parses the console log generated by the Jenkins build allowing for:
...
highlighting of errors, warnings , and info
...
separating the comparison log by sections
collapsible sections for faster viewing
You should use a reporting plugin in Jenkins corresponding to the test framework you have used in your project. e.g. If you are using TestNG , then Jenkins has a publish TestNG reports plugin for filtering out test results.
Similarly for Cucumber - there is pretty cucumber reports plugin.
Jenkins test results screen shows only pass/failed results.
I would like to show quantitive (number/percentage/time duration etc') results, parsed from logs.
e.g. memory usage, run time of specific methods etc..
What is the best way to do so?
Thanks
good question.
i imagine you're probably looking to extend your Jenkins instance with some plugins that describe more info about the tests you've run. this plugin seems relevant, but requires some experience with JMeter (java-based performance measurment tool) to generate the output that this plugin can then read and display output from a JMeter task that you can run every time your build runs:
https://wiki.jenkins-ci.org/display/JENKINS/Performance+Plugin
the 'readme' in the above plugin details page specifies how to set up a project to run JMeter( see the 'Configuring a project to run jmeter performance test:' near the bottom.
another way to do similar not so immediately tied to a specific jenkins build is to run resource monitors (like Cacti or collectd) on the machines running the tests and analyze those results post-build, but again, outside of the Jenkins context.
HTH.
I have multiple jobs running on Jenkins, with some outputs/graphs to measures code quality (warning, unit test result, indicator plots).
How can I create a view that summarize all these informations on one page ?
You can write a script that uses the Jenkins Remote Access API to query the status of various jobs and print a summary.
Then, you can run this script itself as Jenkins job. The summary will appear in the build log of the job.
Another way to do this is to use the dashboard view
The following are fully integrated :
joblist
warning
cppunit test result (each job should publish its result as a post-build action)
cppcheck result (each job should publish its result as a post-build action)
plot display (using the image portlet)
It still dont know how to display Doxygen link...
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