[igt-dev] [PATCH i-g-t] scripts/test_list.py: check key before expanding fields

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Sep 12 13:48:39 UTC 2023


Hi Mauro,
On 2023-09-12 at 11:50:29 +0200, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab at kernel.org>
> 
> The logic used by doc_to_xls.py expands a field that may or may
> not exist, depending on the test set.
> 
> Check it to avoig errors like:
> 
>   File "/home/mchehab/devel/upstream/igt-gpu-tools/scripts/test_list.py", line 819, in get_spreadsheet
>     for field in sorted(list(expand_field_name[item]), key=str.lower):
>                              ~~~~~~~~~~~~~~~~~^^^^^^
>   KeyError: 'GPU excluded platform'
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>

Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>

> ---
>  scripts/test_list.py | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/scripts/test_list.py b/scripts/test_list.py
> index 74abdc5ebe65..fdc3c1998d23 100644
> --- a/scripts/test_list.py
> +++ b/scripts/test_list.py
> @@ -816,6 +816,9 @@ class TestList:
>          for item in sorted(expand_fields.keys(), key=str.lower):
>              prefix = expand_fields[item]
>  
> +            if item not in expand_field_name:
> +                continue
> +
>              for field in sorted(list(expand_field_name[item]), key=str.lower):
>                  row = 0
>                  sheet[row].append(prefix + field)
> -- 
> 2.41.0
> 


More information about the igt-dev mailing list