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

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Tue Sep 12 09:50:29 UTC 2023


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>
---
 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