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? :)

user1340582
  • 19,151
  • 35
  • 115
  • 171

2 Answers2

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

Shurik
  • 562
  • 1
  • 7
  • 19
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

Renat Gilmanov
  • 17,735
  • 5
  • 39
  • 56