From c5c424b4470ee3f0d03f6780729876ed31f97f22 Mon Sep 17 00:00:00 2001 From: Yatsishin Ilya <2159081+qoega@users.noreply.github.com> Date: Fri, 10 Apr 2020 17:26:31 +0300 Subject: [PATCH 1/8] add junit_to_html_util --- utils/junit_to_html/junit-noframes.xsl | 398 +++++++++++++++++++++++++ utils/junit_to_html/junit_to_html | 25 ++ 2 files changed, 423 insertions(+) create mode 100644 utils/junit_to_html/junit-noframes.xsl create mode 100755 utils/junit_to_html/junit_to_html diff --git a/utils/junit_to_html/junit-noframes.xsl b/utils/junit_to_html/junit-noframes.xsl new file mode 100644 index 00000000000..a8df085f719 --- /dev/null +++ b/utils/junit_to_html/junit-noframes.xsl @@ -0,0 +1,398 @@ + + + + + + + + + + Test Results + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

+
+ + + + + + + + + +
+

+ Back to top + + +

Summary

+ + + + + + + + + + + + + + + + + Failure + Error + + + + + + + + +
TestsFailuresErrorsSuccess rateTime
+ + + + + + + +
+ + + + +
+ Note: failures are anticipated and checked for with assertions while errors are unanticipated. +
+
+ + + + +

Test Results

+
+
+ + + Name + Tests + Errors + Failures + Time(s) + + + + + + Name + Tests + Errors + Failures + Time(s) + Time Stamp + Host + + + + + + Name + Status + Type + Time(s) + + + + + + + + + Failure + Error + + + + + + + + + + + + + + + + + + + + + Error + Failure + TableRowColor + + + + + + Failure + + + + Error + + + + Success + + + + + + + + + + + + +

+ + + + + +
+ + + +

+ + + + + +
+ + + + N/A + + + + + + +

+ at line + + + , column + + +
+
+
+ + + + + + + + + + 32 + + + + + + + + + + + + +
+ + + +
+ + +
+ + + +
+ + + +
+
+ + + + + + + + +
diff --git a/utils/junit_to_html/junit_to_html b/utils/junit_to_html/junit_to_html new file mode 100755 index 00000000000..440541c3db6 --- /dev/null +++ b/utils/junit_to_html/junit_to_html @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import os +import sys +import lxml.etree as etree + +def _convert_junit_to_html(junit_path, html_path): + with open(os.path.join(os.path.dirname(__file__), "junit-noframes.xsl")) as xslt_file: + junit_to_html_xslt = etree.parse(xslt_file) + with open(junit_path) as junit_file: + junit_xml = etree.parse(junit_file) + transform = etree.XSLT(junit_to_html_xslt) + print transform(junit_xml) + html = etree.tostring(transform(junit_xml), encoding="utf-8") + html_dir = os.path.dirname(html_path) + if not os.path.exists(html_dir): + os.makedirs(html_dir) + with open(html_path, "w") as html_file: + html_file.write(html) + +if __name__ == "__main__": + if len(sys.argv) < 3: + raise "Insufficient arguments: junit.xml result.html", level + junit_path, html_path = sys.argv[1] , sys.argv[2] + _convert_junit_to_html(junit_path, html_path) From 26a1b3163a3c14f4fc4aead4215716a3d12a0420 Mon Sep 17 00:00:00 2001 From: Yatsishin Ilya <2159081+qoega@users.noreply.github.com> Date: Tue, 14 Apr 2020 10:11:05 +0300 Subject: [PATCH 2/8] better colors --- utils/junit_to_html/junit-noframes.xsl | 11 ++++++----- utils/junit_to_html/junit_to_html | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/junit_to_html/junit-noframes.xsl b/utils/junit_to_html/junit-noframes.xsl index a8df085f719..4532ca87c60 100644 --- a/utils/junit_to_html/junit-noframes.xsl +++ b/utils/junit_to_html/junit-noframes.xsl @@ -34,6 +34,7 @@ under the License. Test Results