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

Jose Fonseca jfonseca at vmware.com
Fri Sep 5 06:06:03 PDT 2014


On 04/09/14 22:23, Dylan Baker wrote:
> 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)

   classname = 'piglit.' + classname

might be slightly more readable.

Either way looks good.

Thanks for this change.

Jose

> +
> +        # Create the root element
>           element = etree.Element('testcase', name=testname,
>                                   classname=classname,
>                                   time=str(data['time']),
>



More information about the Piglit mailing list