diff --git a/roles/validate-tempest/files/tempestmail/tempestmail.py b/roles/validate-tempest/files/tempestmail/tempestmail.py index 3fd0454c5..9c54cb32f 100755 --- a/roles/validate-tempest/files/tempestmail/tempestmail.py +++ b/roles/validate-tempest/files/tempestmail/tempestmail.py @@ -99,9 +99,13 @@ class Mail(object): def render_template(self, data): self.log.debug('Rendering template') env = Environment(loader=FileSystemLoader(self.templates_path)) + env.filters['datetimeformat'] = self.datetimeformat template = env.get_template(self.template) return template.render(data=data) + def datetimeformat(self, value, format="%d-%m-%Y %H:%M"): + return value.strftime(format) + def filter_emails(self, job, data): has_errors = False addresses = [] diff --git a/roles/validate-tempest/files/tempestmail/template/template.html b/roles/validate-tempest/files/tempestmail/template/template.html index 9c604547a..79e4d61bd 100644 --- a/roles/validate-tempest/files/tempestmail/template/template.html +++ b/roles/validate-tempest/files/tempestmail/template/template.html @@ -2,23 +2,32 @@

Hello,

-

Here's the result of the latest tempest run for job {{ data.get('job') }}.

-

The job ran on {{ data.get('date') }}.

-

For more details, you can check the URL: {{ data.get('link') }} (It might take a few minutes to upload the logs).

+

This is an automated email with tempest results for job {{ data.get('job') }}.

+

The job ran on {{ data.get('date')|datetimeformat }}.

{% if 'Not available yet' not in data.get('link') %} -

You can see the stackviz results here +

The logs are being uploaded, and it will be available soon. Usually, it take between 5 and 10 minutes to became available, depending of the amount of data it's being uploaded, so don't worry if you don't see the logs right now.

+

Once the logs are available, you can check clicking here

+

Mostly jobs upstream provides a tool to easily visualize and analyze the performance and execution of each tempest job.

+

This tool is called stackviz, and you can see the results here if available

+ {% else %} +

Unfortunate the script that send this email wasn't able to find the url where the logs are. Perhaps wasn't passed

+

to the script, or something wrong happened. If you think it's a mistake, please contact us on irc.freenode.org

+

on channel #tripleo if it's related to a upstream job, or if you're using this service in your own infrastructure,

+

be sure you are setting the environment variable LOG_PATH in your job.

{% endif %} +

Below you can see a resume of the tempest execution for this particular job:

{% if 'new' in data and data.new %} -

New failures

+

New failures ({{ data.new|length}}):

+

These are new failures for this particular run, some action is needed in order to fix it

{% endif %} - {% if 'covered' in data and data.covered %} -

Known failures

+

Known failures ({{ data.covered|length }}):

+

These are known failures, and should have a launchpad or a bugzilla opened for it.

{% endif %} {% if ('has_errors' in data and 'run' in data) and not data.has_errors and data.run %} -

Job ran successfully!

+

Job ran successfully!

We consider a successfull run even if it has Known failures, since these are covered.

{% endif %} {% if not data.run %} -

There's no tempest results!

+

There's no tempest results!

This means that the TripleO installation might have finished sucessfully, however, tempest either fail before tests started, or didn't ran at all.

+

One of the places to begin check is here (the link might don't exist depending of the type of error) {% endif %}

-

You are receiving this email because someone from TripleO team though you were interested in these results.

+

You are receiving this email because someone from TripleO team though you would be interested in these results.

If you're interested in receive these emails, please submit a code review here including your email address

+

We also have a website with status of our current jobs if you are interested.