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? :)
-
Why don't you include a link to point to the job build url? I think this is more efficient. – ppapapetrou Nov 13 '12 at 09:10
-
590% of the people will never open the link. It has to be in their face. – user1340582 Nov 13 '12 at 09:33
-
Have been able to find a solution for this. Solutions suggested in this thread do not seem to work for me. – sandy Nov 09 '17 at 16:57
2 Answers
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

- 562
- 1
- 7
- 19
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:

- 17,735
- 5
- 39
- 56