[PATCH v2 1/1] tester: Add yaml format to the supported report formats

Chris Johns chrisj at rtems.org
Mon Dec 7 23:02:38 UTC 2020


Hi,

I am sorry about the slow response, I have been side tracked onto other things.

On 4/12/20 3:41 am, clrrm at isep.ipp.pt wrote:
> From: Cláudio Maia <clrrm at isep.ipp.pt>
> 
> ---
>  tester/rt/test.py | 115 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 113 insertions(+), 2 deletions(-)
> 
> diff --git a/tester/rt/test.py b/tester/rt/test.py
> index 9b157e9..e0cfdff 100644
> --- a/tester/rt/test.py
> +++ b/tester/rt/test.py
> @@ -339,9 +339,120 @@ def generate_junit_report(args, reports, start_time, end_time,
>      with open(junit_file, 'w') as f:
>          TestSuite.to_file(f, [ts], prettyprint = True)
>  
> +
> +def generate_yaml_report(args, reports, start_time, end_time,
> +                         total, yaml_file):
> +    """ Generates a YAML file containing information about the test run,
> +    including all test outputs """
> +
> +    try:
> +        import yaml
> +    except ImportError:
> +        print("\nWARNING: To generate the yaml report, the PyYAML module "
> +              "should be installed. HINT: You can use pip to install it!")
> +        return

I have considered this change some more and I feel this should be a hard error
and raised when checking the report format. Generating this warning after a long
test run would frustrate users.

This section of code can be just the import if the import is checked before the
test runs. Have a look at here to add the check ...

https://git.rtems.org/rtems-tools/tree/tester/rt/test.py#n348

... and if the import fails please raise a general error.

Thanks
Chris


More information about the devel mailing list