From 5af9256d4f3d9ad5189ddd7dbe1523fe43138e22 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Sun, 28 Jan 2018 21:07:59 +0100 Subject: Cleaned up JUnit report generation on install (#6977) * Cleaned up JUnit report generation on install The generation of a JUnit report was previously part of the install command. This commit factors the logic into its own module, and uses a template for the generation of the report. It also improves report generation, that now can deal with multiple specs installed at once. Finally, extending the list of supported formats is much easier than before, as it entails just writing a new template. * Polished report generation + added tests for failures and errors The generation of a JUnit report has been polished, so that the stacktrace is correctly displayed with Jenkins JUnit plugin. Standard error is still not used. Added unit tests to cover for installation failures and installation errors. --- templates/reports/junit.xml | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 templates/reports/junit.xml (limited to 'templates') diff --git a/templates/reports/junit.xml b/templates/reports/junit.xml new file mode 100644 index 0000000000..fe2566bd42 --- /dev/null +++ b/templates/reports/junit.xml @@ -0,0 +1,51 @@ + + + +{% for suite in test_suites %} + + +{% for property in suite.properties %} + +{% endfor %} + +{% for test in suite.testcases %} + +{% if test.result == 'failure' %} + +{{ test.exception }} + +{% elif test.result == 'error' %} + +{{ test.exception }} + +{% elif test.result == 'skipped' %} + +{% endif %} +{% if test.stdout %} + +{{ test.stdout }} + +{% endif %} +{% if test.stderr %} + +{{ test.stderr }} + +{% endif %} + +{% endfor %} +{# Add an error tag? #} + +{% endfor %} + -- cgit v1.2.3-60-g2f50