[Piglit] [PATCH] junit.py: Fix handling of special test names.

Dylan Baker baker.dylan.c at gmail.com
Fri Feb 20 18:00:59 PST 2015


This looks fine to me, and fixes our problem.

Jose, is this going to break your setup?

Assuming Jose says that is good:
Reviewed-by: Dylan Baker <baker.dylan.c at gmail.com>

On Fri, Feb 20, 2015 at 05:51:34PM -0800, Mark Janes wrote:
> In junit.py, the testname variable is used by a closure within the
> write_test() scope.  Modifying it breaks the filtering of expected
> failures.
> ---
>  framework/backends/junit.py | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/framework/backends/junit.py b/framework/backends/junit.py
> index ddaf826..d4b5041 100644
> --- a/framework/backends/junit.py
> +++ b/framework/backends/junit.py
> @@ -166,16 +166,17 @@ class JUnitBackend(FileBackend):
>          # set different root names.
>          classname = 'piglit.' + classname
>  
> -        testname += self._test_suffix
> -
>          # Jenkins will display special pages when the test has certain names.
>          # https://jenkins-ci.org/issue/18062
>          # https://jenkins-ci.org/issue/19810
> -        if testname in ('api', 'search'):
> +        # If there is a suffix, then the test link will not be one of
> +        # the reserved names.  Don't modify testname, as it is used in
> +        # the calculate_result closure.
> +        if not self._test_suffix and testname in ('api', 'search'):
>              testname += '_'
>  
>          # Create the root element
> -        element = etree.Element('testcase', name=testname,
> +        element = etree.Element('testcase', name=testname + self._test_suffix,
>                                  classname=classname,
>                                  time=str(data['time']),
>                                  status=str(data['result']))
> -- 
> 2.1.4
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150220/069d34b2/attachment.sig>


More information about the Piglit mailing list