[Piglit] [PATCH 2/3] framework/backends/junit.py: add calculate_group_totals() to load

Mark Janes mark.a.janes at intel.com
Thu Oct 15 17:13:31 PDT 2015


Reviewed-by: Mark Janes <mark.a.janes at intel.com>

baker.dylan.c at gmail.com writes:

> From: Dylan Baker <baker.dylan.c at gmail.com>
>
> This calculates the group totals on load (this is stored in the json),
> which is required to get proper totals information.
> ---
>  framework/backends/junit.py             | 2 ++
>  framework/tests/junit_backends_tests.py | 4 ++++
>  2 files changed, 6 insertions(+)
>
> diff --git a/framework/backends/junit.py b/framework/backends/junit.py
> index ce6a27a..15c6c0b 100644
> --- a/framework/backends/junit.py
> +++ b/framework/backends/junit.py
> @@ -278,6 +278,8 @@ def _load(results_file):
>  
>          run_result.tests[name] = result
>  
> +    run_result.calculate_group_totals()
> +
>      return run_result
>  
>  
> diff --git a/framework/tests/junit_backends_tests.py b/framework/tests/junit_backends_tests.py
> index 1a4be0e..7d5a3fc 100644
> --- a/framework/tests/junit_backends_tests.py
> +++ b/framework/tests/junit_backends_tests.py
> @@ -266,6 +266,10 @@ class TestJUnitLoad(utils.StaticDirectory):
>          nt.eq_(
>              test, 'this is stderr\n\ntime start: 1.0\ntime end: 4.5\n        ')
>  
> +    def test_totals(self):
> +        """backends.junit._load: Totals are calculated."""
> +        nt.ok_(bool(self.xml()))
> +
>  
>      @utils.no_error
>      def test_load_file(self):
> -- 
> 2.6.1


More information about the Piglit mailing list