-
Notifications
You must be signed in to change notification settings - Fork 29
/
short_summary.twig
38 lines (38 loc) · 2.29 KB
/
short_summary.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{# This template renders the short summary for the current test suite. #}
{{ getOutputState(testsuite.state).shortState }} Sakuli suite "{{testsuite.id}}"$whitespace$
{% if (testsuite.state.error) %}
{% set exceptionMessages = errorMessageCreator.exceptionMessageTestSuite(testsuite) %}
({{ format("%.2fs", testsuite.duration) }}) {{testsuite.state.nagiosStateDescription}}: {{abbreviate(exceptionMessages, 200, true)}}
{% else %}
{{testsuite.state.nagiosStateDescription}}
{% if (testsuite.state.ok) %}
$whitespace$({{ format("%.2fs", testsuite.duration) }})
{% elseif (testsuite.state.name == 'WARNING_IN_SUITE') %}
$whitespace$({{ format("%.2fs", testsuite.duration) }}/warn at {{ testsuite.warningTime }}s)
{% elseif (testsuite.state.name == 'CRITICAL_IN_SUITE') %}
$whitespace$({{ format("%.2fs", testsuite.duration) }}/crit at {{ testsuite.criticalTime }}s)
{% elseif (testsuite.state.name == 'WARNING_IN_STEP') %}
{% for testCaseId, testCase in testsuite.testCasesAsSortedSet %}
{% if (testCase.state.warningInStep) %}
{% for testStep in testCase.steps %}
{% if (testStep.state.warning) %}
, step "{{testStep.id}}" over runtime ({{ format("%.2fs", testStep.duration) }}/warn at {{ testStep.warningTime }}s)
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% elseif (testsuite.state.name == 'WARNING_IN_CASE') %}
{% for testCaseId, testCase in testsuite.testCasesAsSortedSet %}
{% if (testCase.state.warning) %}
, case "{{testCase.id}}" over runtime ({{ format("%.2fs", testCase.duration) }}/warn at {{ testCase.warningTime }}s)
{% endif %}
{% endfor %}
{% elseif (testsuite.state.name == 'CRITICAL_IN_CASE') %}
{% for testCaseId, testCase in testsuite.testCasesAsSortedSet %}
{% if (testCase.state.critical) %}
, case "{{testCase.id}}" over runtime ({{ format("%.2fs", testCase.duration) }}/crit at {{ testCase.criticalTime }}s)
{% endif %}
{% endfor %}
{% endif %}
.$whitespace$(Last suite run: {% if (empty(testsuite.stopDate)) %}xx{% else %}{{ testsuite.stopDate|date("dd.MM.YY HH:mm:ss") }}{% endif %})
{% endif %}