How to present unit test graph in Jenkins email report?
Asked Answered
E

2

6

I am using Jenkins to execute our unit tests and send emails to developers. I am using Jelly Script to include the pass/fail results in the email. However, I would also like to include the pass/fail graph that surefire reports presents to you after your testing build has finished. After all, it's the graph we are interested in looking at, right? :)

Ethiopia answered 13/11, 2012 at 8:21 Comment(3)
Why don't you include a link to point to the job build url? I think this is more efficient.Carpo
90% of the people will never open the link. It has to be in their face.Ethiopia
Have been able to find a solution for this. Solutions suggested in this thread do not seem to work for me.Withy
B
2

if your mail is in the html format, than you can access to the image via this url:

[JENKINS_URL]/job/[JOB_NAME]/test/trend

Barnum answered 14/11, 2012 at 14:53 Comment(0)
C
2

By the way, quite useful question. Nobody reads nowadays :) Anyway, from the psychological point of view it is really better to use graphical form, so there are several ways to achieve that.

Solution #1 - Put a link or a reference

It is easy to put a link or image tag with proper URL (the correct one was suggested by Shurik), but you have to make Jenkins public in order to let your recipients see that image. Quite a dangerous approach, by the way.

Solution #2 - Upload an image

Upload the image to some public image hosting and follow Solution #1.

Solution #3 - Attach an image

The idea is to place the encoded image in a separate section of an email. Jenkins will generate the image (can be accessed by the URL), so you can encode it and include in your mail. More details and example:

enter image description here

Chuckchuckfull answered 14/11, 2012 at 21:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.