[Piglit] [PATCH] results.py: add piglit to junit class name

Dylan Baker baker.dylan.c at gmail.com
Thu Sep 4 14:23:54 PDT 2014


This adds 'piglit' as the first group in the junit xml (the classname),
this allows piglit to be run alongside other test suites on jenkins
without poluting the root node.

CC: Jose Fonseca <jfonseca at vmware.com>
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/results.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/framework/results.py b/framework/results.py
index ddadcc1..3a8e9fd 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -405,6 +405,15 @@ class JUnitBackend(FSyncMixin, Backend):
         classname, testname = posixpath.split(name)
         classname = classname.replace('.', '_')
         classname = JUnitBackend._REPLACE.sub('.', classname)
+
+        # Add the test to the piglit group rather than directly to the root
+        # group, this allows piglit junit to be used in conjunction with other
+        # piglit
+        # TODO: It would be nice if other suites integrating with piglit could
+        # set different root names.
+        classname = 'piglit.{}'.format(classname)
+
+        # Create the root element
         element = etree.Element('testcase', name=testname,
                                 classname=classname,
                                 time=str(data['time']),
-- 
2.1.0



More information about the Piglit mailing list