<html>
    <head></head>
    <body>
        <p>Hello,</p>
        <p>Here's the result of the latest tempest run for job {{ data.get('job') }}.</p>
        <p>The job ran on {{ data.get('date') }}.</p>
        <p>For more details, you can check the URL: {{ data.get('link') }} (It might take a few minutes to upload the logs).</p>
    {% if 'new' in data and data.new %}
    <h2>New failures</h2>
    <ul>
    {% for fail in data.new %}
        <li>{{ fail }}</li>
    {% endfor %}
    </ul>
    {% endif %}

    {% if 'covered' in data and data.covered %}
    <h2>Known failures</h2>
    <ul>
    {% for fail in data.covered %}
    <li>{{ fail.failure }} - {{ fail.reason }}</li>
    {% endfor %}
    </ul>
    {% endif %}
    {% if ('has_errors' in data and 'run' in data) and not data.has_errors and data.run %}
    <h2>Job ran successfully!</h2>
    <p>We consider a successfull run even if it has Known failures, since these are covered.</p>
    {% endif %}
    {% if not data.run %}
    <h2>There's no tempest results!</h2>
    <p>This means that the TripleO installation might have finished sucessfully, however, tempest either fail before tests started, or didn't ran at all.</p>
    {% endif %}
    <p></p>
    <p>You are receiving this email because someone from TripleO team though you were interested in these results.</p>
    <p>
    </body>
</html>

