All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 0/5] Do dome cleanups at IGT doc tools
@ 2023-11-28 10:48 Mauro Carvalho Chehab
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 1/5] scripts/test_list.py: better expand subtests Mauro Carvalho Chehab
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2023-11-28 10:48 UTC (permalink / raw)
  To: igt-dev

From: Mauro Carvalho Chehab <mchehab@kernel.org>

This series is aimed to do some cleanup at documentation testlist
scripts, solving some issues pointed by pylint and reorganizing
the code.

The first two patches were already reviewed. This series have them
at the beginning, untouched.

Mauro Carvalho Chehab (5):
  scripts/test_list.py: better expand subtests
  scripts/test_list.py: don't add a blank description
  scripts/test_list.py: Fix trivial pylint issues
  scripts/test_list.py: fix indent at get_subtests()
  igt_doc.py: move the main code to a main() function

 scripts/igt_doc.py   | 122 +++++++++++++++++++++++--------------------
 scripts/test_list.py |  95 +++++++++++++++++----------------
 2 files changed, 114 insertions(+), 103 deletions(-)

-- 
2.42.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [igt-dev] [PATCH i-g-t 1/5] scripts/test_list.py: better expand subtests
  2023-11-28 10:48 [igt-dev] [PATCH i-g-t 0/5] Do dome cleanups at IGT doc tools Mauro Carvalho Chehab
@ 2023-11-28 10:48 ` Mauro Carvalho Chehab
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 2/5] scripts/test_list.py: don't add a blank description Mauro Carvalho Chehab
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2023-11-28 10:48 UTC (permalink / raw)
  To: igt-dev

From: Mauro Carvalho Chehab <mchehab@kernel.org>

Use a better regex when splitting subtests, as used when reading
testlists.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 scripts/test_list.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/test_list.py b/scripts/test_list.py
index 13f788783483..5ff2b18c2dd8 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -1010,6 +1010,9 @@ class TestList:
 
         order = None
 
+        if expand:
+            expand = re.compile(expand)
+
         if sort_field:
             if sort_field.lower() not in self.field_list:
                 sys.exit(f"Field '{sort_field}' is not defined")
@@ -1039,8 +1042,7 @@ class TestList:
             if sort_field:
                 if sort_field in subtest:
                     if expand:
-                        test_list = subtest[sort_field].split(expand)
-                        test_list = [s.strip() for s in test_list]
+                        test_list = expand.split(subtest[sort_field])
 
                         for test_elem in test_list:
                             if test_elem not in subtests:
@@ -1407,7 +1409,7 @@ class TestList:
 
 
         # NOTE: currently, it uses a comma for multi-value delimitter
-        test_subtests = self.get_subtests(sort_field, ",", with_order = True)
+        test_subtests = self.get_subtests(sort_field, ",\s*", with_order = True)
 
         if not os.path.exists(directory):
             os.makedirs(directory)
-- 
2.42.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [igt-dev] [PATCH i-g-t 2/5] scripts/test_list.py: don't add a blank description
  2023-11-28 10:48 [igt-dev] [PATCH i-g-t 0/5] Do dome cleanups at IGT doc tools Mauro Carvalho Chehab
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 1/5] scripts/test_list.py: better expand subtests Mauro Carvalho Chehab
@ 2023-11-28 10:48 ` Mauro Carvalho Chehab
  2023-11-28 15:51   ` Kamil Konieczny
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 3/5] scripts/test_list.py: Fix trivial pylint issues Mauro Carvalho Chehab
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2023-11-28 10:48 UTC (permalink / raw)
  To: igt-dev

From: Mauro Carvalho Chehab <mchehab@kernel.org>

At the first versions, it was assumed that a Description field
would always exist. This is not true anymore.

Stop artificially creating one with an empty value by default.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 scripts/test_list.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/test_list.py b/scripts/test_list.py
index 5ff2b18c2dd8..20377b708f83 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -1270,7 +1270,6 @@ class TestList:
                         self.doc[current_test]["subtest"][current_subtest][field] = self.doc[current_test][field]
 
                     self.doc[current_test]["subtest"][current_subtest]["_summary_"] = match.group(1)
-                    self.doc[current_test]["subtest"][current_subtest]["Description"] = ''
                     self.doc[current_test]["_subtest_line_"][current_subtest] = file_ln
 
                     if not arg_ref:
-- 
2.42.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [igt-dev] [PATCH i-g-t 3/5] scripts/test_list.py: Fix trivial pylint issues
  2023-11-28 10:48 [igt-dev] [PATCH i-g-t 0/5] Do dome cleanups at IGT doc tools Mauro Carvalho Chehab
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 1/5] scripts/test_list.py: better expand subtests Mauro Carvalho Chehab
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 2/5] scripts/test_list.py: don't add a blank description Mauro Carvalho Chehab
@ 2023-11-28 10:48 ` Mauro Carvalho Chehab
  2023-11-28 15:44   ` Kamil Konieczny
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 4/5] scripts/test_list.py: fix indent at get_subtests() Mauro Carvalho Chehab
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2023-11-28 10:48 UTC (permalink / raw)
  To: igt-dev

From: Mauro Carvalho Chehab <mchehab@kernel.org>

There are a couple of small issues pointed by pylint.
Address them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 scripts/test_list.py | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/scripts/test_list.py b/scripts/test_list.py
index 20377b708f83..79b48813171b 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -14,7 +14,6 @@ import glob
 import json
 import os
 import re
-import subprocess
 import sys
 
 MIN_PYTHON = (3, 6)
@@ -337,7 +336,7 @@ class TestList:
                         for name in value.keys():
                             match_type = update.get("include-type", "subtest-match")
 
-                            self.read_testlist(update, match_type, field, item, testlist, name, cfg_path + value[name])
+                            self.read_testlist(match_type, field, testlist, name, cfg_path + value[name])
 
                     update["include"] = testlist
 
@@ -348,7 +347,7 @@ class TestList:
                         for name in value.keys():
                             match_type = update.get("exclude-type", "subtest-match")
 
-                            self.read_testlist(update, match_type, field, item, testlist, name, cfg_path + value[name])
+                            self.read_testlist(match_type, field, testlist, name, cfg_path + value[name])
 
                     update["exclude"] = testlist
 
@@ -452,7 +451,9 @@ class TestList:
 
             self.__add_field(key, sublevel, hierarchy_level, field[key])
 
-    def read_testlist(self, update, match_type, field, item, testlist, name, filename):
+    def read_testlist(self, match_type, field, testlist, name, filename):
+
+        """ Read a list of tests with a common value from a file"""
 
         match_type_regex = set(["regex", "regex-ignorecase"])
         match_type_str = set(["subtest-match"])
@@ -514,9 +515,12 @@ class TestList:
         return False
 
     def update_testlist_field(self, subtest_dict):
-        expand = re.compile(",\s*")
 
-        for field in self.props.keys():
+        """process include and exclude rules used by test lists read from files"""
+
+        expand = re.compile(r",\s*")
+
+        for field in self.props.keys(): # pylint: disable=C0201,C0206
             if "_properties_" not in self.props[field]:
                 continue
 
@@ -524,7 +528,6 @@ class TestList:
             if not update:
                 continue
 
-            match_type = update.get("type", "subtest-match")
             default_value = update.get("default--if-not-excluded")
             append_value = update.get("append-value-if-not-excluded")
 
@@ -739,7 +742,7 @@ class TestList:
     # Output methods
     #
 
-    def print_rest_flat(self, filename = None, return_string = False):
+    def print_rest_flat(self, filename = None, return_string = False): # pylint: disable=R1710
 
         """Print tests and subtests ordered by tests"""
 
@@ -802,7 +805,7 @@ class TestList:
         else:
             return out
 
-    def get_spreadsheet(self, expand_fields = {}):
+    def get_spreadsheet(self, expand_fields = None):
 
         """
         Return a bidimentional array with the test contents.
@@ -811,6 +814,9 @@ class TestList:
         separate python file that would create a workbook's sheet.
         """
 
+        if not expand_fields:
+            expand_fields = {}
+
         expand_field_name = {}
         sheet = []
         row = 0
@@ -880,13 +886,12 @@ class TestList:
 
         return sheet
 
-    def print_nested_rest(self, filename = None, return_string = False):
+    def print_nested_rest(self, filename = None, return_string = False):  # pylint: disable=R1710
 
         """Print tests and subtests ordered by tests"""
 
         handler = None
         if filename:
-            original_stdout = sys.stdout
             handler = open(filename, "w", encoding='utf8') # pylint: disable=R1732
             sys.stdout = handler
 
@@ -1127,14 +1132,12 @@ class TestList:
         mandatory_fields = set()
         for field, item in self.props.items():
             if item["_properties_"].get("mandatory"):
-                    mandatory_fields.add(field)
+                mandatory_fields.add(field)
 
         doc_subtests = set()
 
         args_regex = re.compile(r'\<[^\>]+\>')
 
-        missing_mandatory_fields = False
-
         subtests = self.expand_dictionary(True)
         for subtest, data in sorted(subtests.items()):
             subtest = self.subtest_separator.join(subtest.split(self.subtest_separator)[:3])
@@ -1143,7 +1146,6 @@ class TestList:
             for field in mandatory_fields:
                 if field not in data:
                     print(f"Warning: {subtest} {field} documentation is missing")
-                    missing_mandatory_fields = True
 
             doc_subtests.add(subtest)
 
@@ -1162,7 +1164,7 @@ class TestList:
         if run_missing:
             for test_name in run_missing:
                 print(f'Warning: Missing documentation for {test_name}')
-            print(f'Please refer: docs/test_documentation.md for more details')
+            print('Please refer: docs/test_documentation.md for more details')
 
         if doc_uneeded or run_missing:
             sys.exit(1)
@@ -1408,7 +1410,7 @@ class TestList:
 
 
         # NOTE: currently, it uses a comma for multi-value delimitter
-        test_subtests = self.get_subtests(sort_field, ",\s*", with_order = True)
+        test_subtests = self.get_subtests(sort_field, r",\s*", with_order = True)
 
         if not os.path.exists(directory):
             os.makedirs(directory)
-- 
2.42.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [igt-dev] [PATCH i-g-t 4/5] scripts/test_list.py: fix indent at get_subtests()
  2023-11-28 10:48 [igt-dev] [PATCH i-g-t 0/5] Do dome cleanups at IGT doc tools Mauro Carvalho Chehab
                   ` (2 preceding siblings ...)
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 3/5] scripts/test_list.py: Fix trivial pylint issues Mauro Carvalho Chehab
@ 2023-11-28 10:48 ` Mauro Carvalho Chehab
  2023-11-28 15:57   ` Kamil Konieczny
  2023-11-28 10:49 ` [igt-dev] [PATCH i-g-t 5/5] igt_doc.py: move the main code to a main() function Mauro Carvalho Chehab
  2023-11-28 11:59 ` [igt-dev] ✓ CI.xeBAT: success for Do dome cleanups at IGT doc tools Patchwork
  5 siblings, 1 reply; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2023-11-28 10:48 UTC (permalink / raw)
  To: igt-dev

From: Mauro Carvalho Chehab <mchehab@kernel.org>

The indent there is wrong, causing this warning:

	scripts/test_list.py:1041:46: W0631: Using possibly undefined loop variable 'test' (undefined-loop-variable)

This issue also affects testlist generation, as tests will be
missing there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 scripts/test_list.py | 54 ++++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/scripts/test_list.py b/scripts/test_list.py
index 79b48813171b..3954e883ada3 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -1038,43 +1038,43 @@ class TestList:
 
             subtest_array += self.expand_subtest(fname, test_name, test, True)
 
-        subtest_array.sort(key = lambda x : x.get('_summary_'))
+            subtest_array.sort(key = lambda x : x.get('_summary_'))
 
-        for subtest in subtest_array:
-            if self.__filter_subtest(self.doc[test], subtest, True):
-                continue
+            for subtest in subtest_array:
+                if self.__filter_subtest(self.doc[test], subtest, True):
+                    continue
 
-            if sort_field:
-                if sort_field in subtest:
-                    if expand:
-                        test_list = expand.split(subtest[sort_field])
+                if sort_field:
+                    if sort_field in subtest:
+                        if expand:
+                            test_list = expand.split(subtest[sort_field])
 
-                        for test_elem in test_list:
-                            if test_elem not in subtests:
-                                subtests[test_elem] = []
-                            if order:
-                                subtests[test_elem].append((subtest["_summary_"], test_list))
-                            else:
-                                subtests[test_elem].append(subtest["_summary_"])
+                            for test_elem in test_list:
+                                if test_elem not in subtests:
+                                    subtests[test_elem] = []
+                                if order:
+                                    subtests[test_elem].append((subtest["_summary_"], test_list))
+                                else:
+                                    subtests[test_elem].append(subtest["_summary_"])
+                        else:
+                            if subtest[sort_field] not in subtests:
+                                subtests[subtest[sort_field]] = []
+                                if order:
+                                    subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
+                                else:
+                                    subtests[subtest[sort_field]].append(subtest["_summary_"])
                     else:
-                        if subtest[sort_field] not in subtests:
-                            subtests[subtest[sort_field]] = []
-                            if order:
-                                subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
-                            else:
-                                subtests[subtest[sort_field]].append(subtest["_summary_"])
+                        if order:
+                            subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
+                        else:
+                            subtests[""].append(subtest["_summary_"])
+
                 else:
                     if order:
                         subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
                     else:
                         subtests[""].append(subtest["_summary_"])
 
-            else:
-                if order:
-                    subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
-                else:
-                    subtests[""].append(subtest["_summary_"])
-
         if order:
             for group, tests in subtests.items():
                 prefix_tests = []
-- 
2.42.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [igt-dev] [PATCH i-g-t 5/5] igt_doc.py: move the main code to a main() function
  2023-11-28 10:48 [igt-dev] [PATCH i-g-t 0/5] Do dome cleanups at IGT doc tools Mauro Carvalho Chehab
                   ` (3 preceding siblings ...)
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 4/5] scripts/test_list.py: fix indent at get_subtests() Mauro Carvalho Chehab
@ 2023-11-28 10:49 ` Mauro Carvalho Chehab
  2023-11-28 15:59   ` Kamil Konieczny
  2023-11-28 11:59 ` [igt-dev] ✓ CI.xeBAT: success for Do dome cleanups at IGT doc tools Patchwork
  5 siblings, 1 reply; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2023-11-28 10:49 UTC (permalink / raw)
  To: igt-dev

From: Mauro Carvalho Chehab <mchehab@kernel.org>

That avoids having global variables inside the script and
makes easier to add IGT-specific classes there.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 scripts/igt_doc.py | 122 ++++++++++++++++++++++++---------------------
 1 file changed, 65 insertions(+), 57 deletions(-)

diff --git a/scripts/igt_doc.py b/scripts/igt_doc.py
index 86e49970ea28..ab6179366831 100755
--- a/scripts/igt_doc.py
+++ b/scripts/igt_doc.py
@@ -15,69 +15,77 @@ import sys
 
 from test_list import TestList
 
-IGT_BUILD_PATH = 'build'
+def main():
+    """
+    Main logic
+    """
 
-parser = argparse.ArgumentParser(description = "Print formatted kernel documentation to stdout.",
-                                 formatter_class = argparse.ArgumentDefaultsHelpFormatter,
-                                 epilog = 'If no action specified, assume --rest.')
-parser.add_argument("--config", required = True,
-                    help="JSON file describing the test plan template")
-parser.add_argument("--rest",
-                    help="Output documentation from the source files in REST file.")
-parser.add_argument("--per-test", action="store_true",
-                    help="Modifies ReST output to print subtests per test.")
-parser.add_argument("--to-json",
-                    help="Output test documentation in JSON format as TO_JSON file")
-parser.add_argument("--show-subtests", action="store_true",
-                    help="Shows the name of the documented subtests in alphabetical order.")
-parser.add_argument("--sort-field",
-                    help="modify --show-subtests to sort output based on SORT_FIELD value")
-parser.add_argument("--filter-field", nargs='*',
-                    help="filter subtests based on regular expressions given by FILTER_FIELD=~'regex'")
-parser.add_argument("--check-testlist", action="store_true",
-                    help="Compare documentation against IGT built tests.")
-parser.add_argument("--include-plan", action="store_true",
-                    help="Include test plans, if any.")
-parser.add_argument("--igt-build-path",
-                    help="Path to the IGT build directory. Used by --check-testlist.",
-                    default=IGT_BUILD_PATH)
-parser.add_argument("--gen-testlist",
-                    help="Generate documentation at the GEN_TESTLIST directory, using SORT_FIELD to split the tests. Requires --sort-field.")
-parser.add_argument('--files', nargs='+',
-                    help="File name(s) to be processed")
+    igt_build_path = 'build'
 
-parse_args = parser.parse_args()
+    parser = argparse.ArgumentParser(description = "Print formatted kernel documentation to stdout.",
+                                    formatter_class = argparse.ArgumentDefaultsHelpFormatter,
+                                    epilog = 'If no action specified, assume --rest.')
+    parser.add_argument("--config", required = True,
+                        help="JSON file describing the test plan template")
+    parser.add_argument("--rest",
+                        help="Output documentation from the source files in REST file.")
+    parser.add_argument("--per-test", action="store_true",
+                        help="Modifies ReST output to print subtests per test.")
+    parser.add_argument("--to-json",
+                        help="Output test documentation in JSON format as TO_JSON file")
+    parser.add_argument("--show-subtests", action="store_true",
+                        help="Shows the name of the documented subtests in alphabetical order.")
+    parser.add_argument("--sort-field",
+                        help="modify --show-subtests to sort output based on SORT_FIELD value")
+    parser.add_argument("--filter-field", nargs='*',
+                        help="filter subtests based on regular expressions given by FILTER_FIELD=~'regex'")
+    parser.add_argument("--check-testlist", action="store_true",
+                        help="Compare documentation against IGT built tests.")
+    parser.add_argument("--include-plan", action="store_true",
+                        help="Include test plans, if any.")
+    parser.add_argument("--igt-build-path",
+                        help="Path to the IGT build directory. Used by --check-testlist.",
+                        default=igt_build_path)
+    parser.add_argument("--gen-testlist",
+                        help="Generate documentation at the GEN_TESTLIST directory, using SORT_FIELD to split the tests. Requires --sort-field.")
+    parser.add_argument('--files', nargs='+',
+                        help="File name(s) to be processed")
 
-tests = TestList(config_fname = parse_args.config,
-                 include_plan = parse_args.include_plan,
-                 file_list = parse_args.files,
-                 igt_build_path = parse_args.igt_build_path)
+    parse_args = parser.parse_args()
 
-if parse_args.filter_field:
-    for filter_expr in parse_args.filter_field:
-        tests.add_filter(filter_expr)
+    tests = TestList(config_fname = parse_args.config,
+                        include_plan = parse_args.include_plan,
+                        file_list = parse_args.files,
+                        igt_build_path = parse_args.igt_build_path)
 
-RUN = 0
-if parse_args.show_subtests:
-    RUN = 1
-    tests.show_subtests(parse_args.sort_field)
+    if parse_args.filter_field:
+        for filter_expr in parse_args.filter_field:
+            tests.add_filter(filter_expr)
 
-if parse_args.check_testlist:
-    RUN = 1
-    tests.check_tests()
+    run = False
+    if parse_args.show_subtests:
+        run = True
+        tests.show_subtests(parse_args.sort_field)
 
-if parse_args.gen_testlist:
-    RUN = 1
-    if not parse_args.sort_field:
-        sys.exit("Need a field to split the testlists")
-    tests.gen_testlist(parse_args.gen_testlist, parse_args.sort_field)
+    if parse_args.check_testlist:
+        run = True
+        tests.check_tests()
 
-if parse_args.to_json:
-    RUN = 1
-    tests.print_json(parse_args.to_json)
+    if parse_args.gen_testlist:
+        run = True
+        if not parse_args.sort_field:
+            sys.exit("Need a field to split the testlists")
+        tests.gen_testlist(parse_args.gen_testlist, parse_args.sort_field)
 
-if not RUN or parse_args.rest:
-    if parse_args.per_test:
-        tests.print_rest_flat(parse_args.rest)
-    else:
-        tests.print_nested_rest(parse_args.rest)
+    if parse_args.to_json:
+        run = True
+        tests.print_json(parse_args.to_json)
+
+    if not run or parse_args.rest:
+        if parse_args.per_test:
+            tests.print_rest_flat(parse_args.rest)
+        else:
+            tests.print_nested_rest(parse_args.rest)
+
+if __name__ == '__main__':
+    main()
-- 
2.42.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [igt-dev] ✓ CI.xeBAT: success for Do dome cleanups at IGT doc tools
  2023-11-28 10:48 [igt-dev] [PATCH i-g-t 0/5] Do dome cleanups at IGT doc tools Mauro Carvalho Chehab
                   ` (4 preceding siblings ...)
  2023-11-28 10:49 ` [igt-dev] [PATCH i-g-t 5/5] igt_doc.py: move the main code to a main() function Mauro Carvalho Chehab
@ 2023-11-28 11:59 ` Patchwork
  5 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2023-11-28 11:59 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 11644 bytes --]

== Series Details ==

Series: Do dome cleanups at IGT doc tools
URL   : https://patchwork.freedesktop.org/series/126972/
State : success

== Summary ==

CI Bug Log - changes from XEIGT_7605_BAT -> XEIGTPW_10279_BAT
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Participating hosts (1 -> 4)
------------------------------

  Additional (3): bat-pvc-2 bat-dg2-oem2 bat-atsm-2 

Known issues
------------

  Here are the changes found in XEIGTPW_10279_BAT that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@core_hotunplug@unbind-rebind:
    - bat-atsm-2:         NOTRUN -> [INCOMPLETE][1] ([Intel XE#764])
   [1]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@core_hotunplug@unbind-rebind.html

  * igt@kms_addfb_basic@addfb25-x-tiled-legacy:
    - bat-pvc-2:          NOTRUN -> [SKIP][2] ([i915#6077]) +33 other tests skip
   [2]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@kms_addfb_basic@addfb25-x-tiled-legacy.html

  * igt@kms_addfb_basic@addfb25-y-tiled-small-legacy:
    - bat-dg2-oem2:       NOTRUN -> [SKIP][3] ([Intel XE#623])
   [3]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-dg2-oem2/igt@kms_addfb_basic@addfb25-y-tiled-small-legacy.html

  * igt@kms_addfb_basic@basic-y-tiled-legacy:
    - bat-dg2-oem2:       NOTRUN -> [SKIP][4] ([Intel XE#388]) +2 other tests skip
   [4]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-dg2-oem2/igt@kms_addfb_basic@basic-y-tiled-legacy.html

  * igt@kms_addfb_basic@invalid-set-prop-any:
    - bat-atsm-2:         NOTRUN -> [SKIP][5] ([i915#6077]) +33 other tests skip
   [5]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@kms_addfb_basic@invalid-set-prop-any.html

  * igt@kms_cursor_legacy@basic-flip-after-cursor-atomic:
    - bat-pvc-2:          NOTRUN -> [SKIP][6] ([Intel XE#782]) +5 other tests skip
   [6]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@kms_cursor_legacy@basic-flip-after-cursor-atomic.html

  * igt@kms_cursor_legacy@basic-flip-before-cursor-legacy:
    - bat-atsm-2:         NOTRUN -> [SKIP][7] ([Intel XE#782]) +5 other tests skip
   [7]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@kms_cursor_legacy@basic-flip-before-cursor-legacy.html

  * igt@kms_dsc@dsc-basic:
    - bat-atsm-2:         NOTRUN -> [SKIP][8] ([Intel XE#784])
   [8]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@kms_dsc@dsc-basic.html
    - bat-pvc-2:          NOTRUN -> [SKIP][9] ([Intel XE#784])
   [9]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@kms_dsc@dsc-basic.html
    - bat-dg2-oem2:       NOTRUN -> [SKIP][10] ([Intel XE#423])
   [10]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-dg2-oem2/igt@kms_dsc@dsc-basic.html

  * igt@kms_flip@basic-flip-vs-dpms:
    - bat-pvc-2:          NOTRUN -> [SKIP][11] ([Intel XE#947]) +3 other tests skip
   [11]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@kms_flip@basic-flip-vs-dpms.html

  * igt@kms_flip@basic-flip-vs-modeset:
    - bat-atsm-2:         NOTRUN -> [SKIP][12] ([Intel XE#947]) +3 other tests skip
   [12]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@kms_flip@basic-flip-vs-modeset.html

  * igt@kms_force_connector_basic@force-connector-state:
    - bat-pvc-2:          NOTRUN -> [SKIP][13] ([Intel XE#540]) +3 other tests skip
   [13]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@kms_force_connector_basic@force-connector-state.html
    - bat-atsm-2:         NOTRUN -> [SKIP][14] ([Intel XE#540]) +3 other tests skip
   [14]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@kms_force_connector_basic@force-connector-state.html

  * igt@kms_force_connector_basic@prune-stale-modes:
    - bat-dg2-oem2:       NOTRUN -> [SKIP][15] ([i915#5274])
   [15]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-dg2-oem2/igt@kms_force_connector_basic@prune-stale-modes.html

  * igt@kms_frontbuffer_tracking@basic:
    - bat-pvc-2:          NOTRUN -> [SKIP][16] ([Intel XE#783])
   [16]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@kms_frontbuffer_tracking@basic.html
    - bat-dg2-oem2:       NOTRUN -> [FAIL][17] ([Intel XE#608])
   [17]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-dg2-oem2/igt@kms_frontbuffer_tracking@basic.html
    - bat-atsm-2:         NOTRUN -> [SKIP][18] ([Intel XE#783])
   [18]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@kms_frontbuffer_tracking@basic.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12:
    - bat-dg2-oem2:       NOTRUN -> [FAIL][19] ([Intel XE#400] / [Intel XE#616]) +2 other tests fail
   [19]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-dg2-oem2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-nv12.html

  * igt@kms_pipe_crc_basic@compare-crc-sanitycheck-xr24:
    - bat-atsm-2:         NOTRUN -> [SKIP][20] ([i915#1836]) +6 other tests skip
   [20]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-xr24.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence:
    - bat-pvc-2:          NOTRUN -> [SKIP][21] ([Intel XE#829]) +6 other tests skip
   [21]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence.html

  * igt@kms_prop_blob@basic:
    - bat-pvc-2:          NOTRUN -> [SKIP][22] ([Intel XE#780])
   [22]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@kms_prop_blob@basic.html
    - bat-atsm-2:         NOTRUN -> [SKIP][23] ([Intel XE#780])
   [23]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@kms_prop_blob@basic.html

  * igt@xe_compute@compute-square:
    - bat-atsm-2:         NOTRUN -> [SKIP][24] ([Intel XE#672])
   [24]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@xe_compute@compute-square.html
    - bat-dg2-oem2:       NOTRUN -> [SKIP][25] ([Intel XE#672])
   [25]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-dg2-oem2/igt@xe_compute@compute-square.html

  * igt@xe_evict@evict-beng-small-external:
    - bat-pvc-2:          NOTRUN -> [FAIL][26] ([Intel XE#936]) +3 other tests fail
   [26]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@xe_evict@evict-beng-small-external.html

  * igt@xe_evict@evict-small-cm:
    - bat-pvc-2:          NOTRUN -> [DMESG-FAIL][27] ([Intel XE#482]) +3 other tests dmesg-fail
   [27]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@xe_evict@evict-small-cm.html

  * igt@xe_exec_fault_mode@many-basic:
    - bat-dg2-oem2:       NOTRUN -> [SKIP][28] ([Intel XE#288]) +17 other tests skip
   [28]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-dg2-oem2/igt@xe_exec_fault_mode@many-basic.html

  * igt@xe_guc_pc@freq_range_idle:
    - bat-pvc-2:          NOTRUN -> [SKIP][29] ([Intel XE#533]) +1 other test skip
   [29]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@xe_guc_pc@freq_range_idle.html

  * igt@xe_huc_copy@huc_copy:
    - bat-pvc-2:          NOTRUN -> [SKIP][30] ([Intel XE#255])
   [30]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@xe_huc_copy@huc_copy.html
    - bat-dg2-oem2:       NOTRUN -> [SKIP][31] ([Intel XE#255])
   [31]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-dg2-oem2/igt@xe_huc_copy@huc_copy.html
    - bat-atsm-2:         NOTRUN -> [SKIP][32] ([Intel XE#255])
   [32]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-atsm-2/igt@xe_huc_copy@huc_copy.html

  * igt@xe_intel_bb@render:
    - bat-pvc-2:          NOTRUN -> [SKIP][33] ([Intel XE#532])
   [33]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@xe_intel_bb@render.html

  * igt@xe_module_load@load:
    - bat-pvc-2:          NOTRUN -> [SKIP][34] ([Intel XE#378])
   [34]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@xe_module_load@load.html

  * igt@xe_pm_residency@gt-c6-on-idle:
    - bat-pvc-2:          NOTRUN -> [SKIP][35] ([Intel XE#531])
   [35]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-pvc-2/igt@xe_pm_residency@gt-c6-on-idle.html

  
#### Possible fixes ####

  * igt@kms_flip@basic-flip-vs-wf_vblank:
    - bat-adlp-7:         [FAIL][36] ([Intel XE#480]) -> [PASS][37] +1 other test pass
   [36]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7605/bat-adlp-7/igt@kms_flip@basic-flip-vs-wf_vblank.html
   [37]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/bat-adlp-7/igt@kms_flip@basic-flip-vs-wf_vblank.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [Intel XE#255]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/255
  [Intel XE#288]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/288
  [Intel XE#378]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/378
  [Intel XE#388]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/388
  [Intel XE#392]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/392
  [Intel XE#400]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/400
  [Intel XE#423]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/423
  [Intel XE#480]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/480
  [Intel XE#482]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/482
  [Intel XE#524]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/524
  [Intel XE#531]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/531
  [Intel XE#532]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/532
  [Intel XE#533]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/533
  [Intel XE#540]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/540
  [Intel XE#608]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/608
  [Intel XE#616]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/616
  [Intel XE#623]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/623
  [Intel XE#672]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/672
  [Intel XE#764]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/764
  [Intel XE#780]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/780
  [Intel XE#782]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/782
  [Intel XE#783]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/783
  [Intel XE#784]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/784
  [Intel XE#829]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/829
  [Intel XE#926]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/926
  [Intel XE#929]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/929
  [Intel XE#936]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/936
  [Intel XE#947]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/947
  [i915#1836]: https://gitlab.freedesktop.org/drm/intel/issues/1836
  [i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
  [i915#6077]: https://gitlab.freedesktop.org/drm/intel/issues/6077


Build changes
-------------

  * IGT: IGT_7605 -> IGTPW_10279
  * Linux: xe-520-7c4b213b5a33fc591a5c92910292aea30193f96c -> xe-525-417251e59231e74f32b995403a66588e6960da2b

  IGTPW_10279: 10279
  IGT_7605: 7605
  xe-520-7c4b213b5a33fc591a5c92910292aea30193f96c: 7c4b213b5a33fc591a5c92910292aea30193f96c
  xe-525-417251e59231e74f32b995403a66588e6960da2b: 417251e59231e74f32b995403a66588e6960da2b

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_10279/index.html

[-- Attachment #2: Type: text/html, Size: 13419 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 3/5] scripts/test_list.py: Fix trivial pylint issues
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 3/5] scripts/test_list.py: Fix trivial pylint issues Mauro Carvalho Chehab
@ 2023-11-28 15:44   ` Kamil Konieczny
  0 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-11-28 15:44 UTC (permalink / raw)
  To: igt-dev

Hi Mauro,
On 2023-11-28 at 11:48:58 +0100, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab@kernel.org>
> 
> There are a couple of small issues pointed by pylint.
> Address them.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

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

> ---
>  scripts/test_list.py | 36 +++++++++++++++++++-----------------
>  1 file changed, 19 insertions(+), 17 deletions(-)
> 
> diff --git a/scripts/test_list.py b/scripts/test_list.py
> index 20377b708f83..79b48813171b 100644
> --- a/scripts/test_list.py
> +++ b/scripts/test_list.py
> @@ -14,7 +14,6 @@ import glob
>  import json
>  import os
>  import re
> -import subprocess
>  import sys
>  
>  MIN_PYTHON = (3, 6)
> @@ -337,7 +336,7 @@ class TestList:
>                          for name in value.keys():
>                              match_type = update.get("include-type", "subtest-match")
>  
> -                            self.read_testlist(update, match_type, field, item, testlist, name, cfg_path + value[name])
> +                            self.read_testlist(match_type, field, testlist, name, cfg_path + value[name])
>  
>                      update["include"] = testlist
>  
> @@ -348,7 +347,7 @@ class TestList:
>                          for name in value.keys():
>                              match_type = update.get("exclude-type", "subtest-match")
>  
> -                            self.read_testlist(update, match_type, field, item, testlist, name, cfg_path + value[name])
> +                            self.read_testlist(match_type, field, testlist, name, cfg_path + value[name])
>  
>                      update["exclude"] = testlist
>  
> @@ -452,7 +451,9 @@ class TestList:
>  
>              self.__add_field(key, sublevel, hierarchy_level, field[key])
>  
> -    def read_testlist(self, update, match_type, field, item, testlist, name, filename):
> +    def read_testlist(self, match_type, field, testlist, name, filename):
> +
> +        """ Read a list of tests with a common value from a file"""
>  
>          match_type_regex = set(["regex", "regex-ignorecase"])
>          match_type_str = set(["subtest-match"])
> @@ -514,9 +515,12 @@ class TestList:
>          return False
>  
>      def update_testlist_field(self, subtest_dict):
> -        expand = re.compile(",\s*")
>  
> -        for field in self.props.keys():
> +        """process include and exclude rules used by test lists read from files"""
> +
> +        expand = re.compile(r",\s*")
> +
> +        for field in self.props.keys(): # pylint: disable=C0201,C0206
>              if "_properties_" not in self.props[field]:
>                  continue
>  
> @@ -524,7 +528,6 @@ class TestList:
>              if not update:
>                  continue
>  
> -            match_type = update.get("type", "subtest-match")
>              default_value = update.get("default--if-not-excluded")
>              append_value = update.get("append-value-if-not-excluded")
>  
> @@ -739,7 +742,7 @@ class TestList:
>      # Output methods
>      #
>  
> -    def print_rest_flat(self, filename = None, return_string = False):
> +    def print_rest_flat(self, filename = None, return_string = False): # pylint: disable=R1710
>  
>          """Print tests and subtests ordered by tests"""
>  
> @@ -802,7 +805,7 @@ class TestList:
>          else:
>              return out
>  
> -    def get_spreadsheet(self, expand_fields = {}):
> +    def get_spreadsheet(self, expand_fields = None):
>  
>          """
>          Return a bidimentional array with the test contents.
> @@ -811,6 +814,9 @@ class TestList:
>          separate python file that would create a workbook's sheet.
>          """
>  
> +        if not expand_fields:
> +            expand_fields = {}
> +
>          expand_field_name = {}
>          sheet = []
>          row = 0
> @@ -880,13 +886,12 @@ class TestList:
>  
>          return sheet
>  
> -    def print_nested_rest(self, filename = None, return_string = False):
> +    def print_nested_rest(self, filename = None, return_string = False):  # pylint: disable=R1710
>  
>          """Print tests and subtests ordered by tests"""
>  
>          handler = None
>          if filename:
> -            original_stdout = sys.stdout
>              handler = open(filename, "w", encoding='utf8') # pylint: disable=R1732
>              sys.stdout = handler
>  
> @@ -1127,14 +1132,12 @@ class TestList:
>          mandatory_fields = set()
>          for field, item in self.props.items():
>              if item["_properties_"].get("mandatory"):
> -                    mandatory_fields.add(field)
> +                mandatory_fields.add(field)
>  
>          doc_subtests = set()
>  
>          args_regex = re.compile(r'\<[^\>]+\>')
>  
> -        missing_mandatory_fields = False
> -
>          subtests = self.expand_dictionary(True)
>          for subtest, data in sorted(subtests.items()):
>              subtest = self.subtest_separator.join(subtest.split(self.subtest_separator)[:3])
> @@ -1143,7 +1146,6 @@ class TestList:
>              for field in mandatory_fields:
>                  if field not in data:
>                      print(f"Warning: {subtest} {field} documentation is missing")
> -                    missing_mandatory_fields = True
>  
>              doc_subtests.add(subtest)
>  
> @@ -1162,7 +1164,7 @@ class TestList:
>          if run_missing:
>              for test_name in run_missing:
>                  print(f'Warning: Missing documentation for {test_name}')
> -            print(f'Please refer: docs/test_documentation.md for more details')
> +            print('Please refer: docs/test_documentation.md for more details')
>  
>          if doc_uneeded or run_missing:
>              sys.exit(1)
> @@ -1408,7 +1410,7 @@ class TestList:
>  
>  
>          # NOTE: currently, it uses a comma for multi-value delimitter
> -        test_subtests = self.get_subtests(sort_field, ",\s*", with_order = True)
> +        test_subtests = self.get_subtests(sort_field, r",\s*", with_order = True)
>  
>          if not os.path.exists(directory):
>              os.makedirs(directory)
> -- 
> 2.42.0
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 2/5] scripts/test_list.py: don't add a blank description
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 2/5] scripts/test_list.py: don't add a blank description Mauro Carvalho Chehab
@ 2023-11-28 15:51   ` Kamil Konieczny
  0 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-11-28 15:51 UTC (permalink / raw)
  To: igt-dev

Hi Mauro,
On 2023-11-28 at 11:48:57 +0100, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab@kernel.org>
> 
> At the first versions, it was assumed that a Description field
> would always exist. This is not true anymore.
> 
> Stop artificially creating one with an empty value by default.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Duplicate signature, please leave only one.

Regards,
Kamil

> ---
>  scripts/test_list.py | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/scripts/test_list.py b/scripts/test_list.py
> index 5ff2b18c2dd8..20377b708f83 100644
> --- a/scripts/test_list.py
> +++ b/scripts/test_list.py
> @@ -1270,7 +1270,6 @@ class TestList:
>                          self.doc[current_test]["subtest"][current_subtest][field] = self.doc[current_test][field]
>  
>                      self.doc[current_test]["subtest"][current_subtest]["_summary_"] = match.group(1)
> -                    self.doc[current_test]["subtest"][current_subtest]["Description"] = ''
>                      self.doc[current_test]["_subtest_line_"][current_subtest] = file_ln
>  
>                      if not arg_ref:
> -- 
> 2.42.0
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 4/5] scripts/test_list.py: fix indent at get_subtests()
  2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 4/5] scripts/test_list.py: fix indent at get_subtests() Mauro Carvalho Chehab
@ 2023-11-28 15:57   ` Kamil Konieczny
  0 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-11-28 15:57 UTC (permalink / raw)
  To: igt-dev

Hi Mauro,
On 2023-11-28 at 11:48:59 +0100, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab@kernel.org>
> 
> The indent there is wrong, causing this warning:
> 
> 	scripts/test_list.py:1041:46: W0631: Using possibly undefined loop variable 'test' (undefined-loop-variable)
> 
> This issue also affects testlist generation, as tests will be
> missing there.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

Acked-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>

> ---
>  scripts/test_list.py | 54 ++++++++++++++++++++++----------------------
>  1 file changed, 27 insertions(+), 27 deletions(-)
> 
> diff --git a/scripts/test_list.py b/scripts/test_list.py
> index 79b48813171b..3954e883ada3 100644
> --- a/scripts/test_list.py
> +++ b/scripts/test_list.py
> @@ -1038,43 +1038,43 @@ class TestList:
>  
>              subtest_array += self.expand_subtest(fname, test_name, test, True)
>  
> -        subtest_array.sort(key = lambda x : x.get('_summary_'))
> +            subtest_array.sort(key = lambda x : x.get('_summary_'))
>  
> -        for subtest in subtest_array:
> -            if self.__filter_subtest(self.doc[test], subtest, True):
> -                continue
> +            for subtest in subtest_array:
> +                if self.__filter_subtest(self.doc[test], subtest, True):
> +                    continue
>  
> -            if sort_field:
> -                if sort_field in subtest:
> -                    if expand:
> -                        test_list = expand.split(subtest[sort_field])
> +                if sort_field:
> +                    if sort_field in subtest:
> +                        if expand:
> +                            test_list = expand.split(subtest[sort_field])
>  
> -                        for test_elem in test_list:
> -                            if test_elem not in subtests:
> -                                subtests[test_elem] = []
> -                            if order:
> -                                subtests[test_elem].append((subtest["_summary_"], test_list))
> -                            else:
> -                                subtests[test_elem].append(subtest["_summary_"])
> +                            for test_elem in test_list:
> +                                if test_elem not in subtests:
> +                                    subtests[test_elem] = []
> +                                if order:
> +                                    subtests[test_elem].append((subtest["_summary_"], test_list))
> +                                else:
> +                                    subtests[test_elem].append(subtest["_summary_"])
> +                        else:
> +                            if subtest[sort_field] not in subtests:
> +                                subtests[subtest[sort_field]] = []
> +                                if order:
> +                                    subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
> +                                else:
> +                                    subtests[subtest[sort_field]].append(subtest["_summary_"])
>                      else:
> -                        if subtest[sort_field] not in subtests:
> -                            subtests[subtest[sort_field]] = []
> -                            if order:
> -                                subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
> -                            else:
> -                                subtests[subtest[sort_field]].append(subtest["_summary_"])
> +                        if order:
> +                            subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
> +                        else:
> +                            subtests[""].append(subtest["_summary_"])
> +
>                  else:
>                      if order:
>                          subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
>                      else:
>                          subtests[""].append(subtest["_summary_"])
>  
> -            else:
> -                if order:
> -                    subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
> -                else:
> -                    subtests[""].append(subtest["_summary_"])
> -
>          if order:
>              for group, tests in subtests.items():
>                  prefix_tests = []
> -- 
> 2.42.0
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [igt-dev] [PATCH i-g-t 5/5] igt_doc.py: move the main code to a main() function
  2023-11-28 10:49 ` [igt-dev] [PATCH i-g-t 5/5] igt_doc.py: move the main code to a main() function Mauro Carvalho Chehab
@ 2023-11-28 15:59   ` Kamil Konieczny
  0 siblings, 0 replies; 11+ messages in thread
From: Kamil Konieczny @ 2023-11-28 15:59 UTC (permalink / raw)
  To: igt-dev

Hi Mauro,
On 2023-11-28 at 11:49:00 +0100, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab@kernel.org>
> 
> That avoids having global variables inside the script and
> makes easier to add IGT-specific classes there.
> 
> No functional changes.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

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

> ---
>  scripts/igt_doc.py | 122 ++++++++++++++++++++++++---------------------
>  1 file changed, 65 insertions(+), 57 deletions(-)
> 
> diff --git a/scripts/igt_doc.py b/scripts/igt_doc.py
> index 86e49970ea28..ab6179366831 100755
> --- a/scripts/igt_doc.py
> +++ b/scripts/igt_doc.py
> @@ -15,69 +15,77 @@ import sys
>  
>  from test_list import TestList
>  
> -IGT_BUILD_PATH = 'build'
> +def main():
> +    """
> +    Main logic
> +    """
>  
> -parser = argparse.ArgumentParser(description = "Print formatted kernel documentation to stdout.",
> -                                 formatter_class = argparse.ArgumentDefaultsHelpFormatter,
> -                                 epilog = 'If no action specified, assume --rest.')
> -parser.add_argument("--config", required = True,
> -                    help="JSON file describing the test plan template")
> -parser.add_argument("--rest",
> -                    help="Output documentation from the source files in REST file.")
> -parser.add_argument("--per-test", action="store_true",
> -                    help="Modifies ReST output to print subtests per test.")
> -parser.add_argument("--to-json",
> -                    help="Output test documentation in JSON format as TO_JSON file")
> -parser.add_argument("--show-subtests", action="store_true",
> -                    help="Shows the name of the documented subtests in alphabetical order.")
> -parser.add_argument("--sort-field",
> -                    help="modify --show-subtests to sort output based on SORT_FIELD value")
> -parser.add_argument("--filter-field", nargs='*',
> -                    help="filter subtests based on regular expressions given by FILTER_FIELD=~'regex'")
> -parser.add_argument("--check-testlist", action="store_true",
> -                    help="Compare documentation against IGT built tests.")
> -parser.add_argument("--include-plan", action="store_true",
> -                    help="Include test plans, if any.")
> -parser.add_argument("--igt-build-path",
> -                    help="Path to the IGT build directory. Used by --check-testlist.",
> -                    default=IGT_BUILD_PATH)
> -parser.add_argument("--gen-testlist",
> -                    help="Generate documentation at the GEN_TESTLIST directory, using SORT_FIELD to split the tests. Requires --sort-field.")
> -parser.add_argument('--files', nargs='+',
> -                    help="File name(s) to be processed")
> +    igt_build_path = 'build'
>  
> -parse_args = parser.parse_args()
> +    parser = argparse.ArgumentParser(description = "Print formatted kernel documentation to stdout.",
> +                                    formatter_class = argparse.ArgumentDefaultsHelpFormatter,
> +                                    epilog = 'If no action specified, assume --rest.')
> +    parser.add_argument("--config", required = True,
> +                        help="JSON file describing the test plan template")
> +    parser.add_argument("--rest",
> +                        help="Output documentation from the source files in REST file.")
> +    parser.add_argument("--per-test", action="store_true",
> +                        help="Modifies ReST output to print subtests per test.")
> +    parser.add_argument("--to-json",
> +                        help="Output test documentation in JSON format as TO_JSON file")
> +    parser.add_argument("--show-subtests", action="store_true",
> +                        help="Shows the name of the documented subtests in alphabetical order.")
> +    parser.add_argument("--sort-field",
> +                        help="modify --show-subtests to sort output based on SORT_FIELD value")
> +    parser.add_argument("--filter-field", nargs='*',
> +                        help="filter subtests based on regular expressions given by FILTER_FIELD=~'regex'")
> +    parser.add_argument("--check-testlist", action="store_true",
> +                        help="Compare documentation against IGT built tests.")
> +    parser.add_argument("--include-plan", action="store_true",
> +                        help="Include test plans, if any.")
> +    parser.add_argument("--igt-build-path",
> +                        help="Path to the IGT build directory. Used by --check-testlist.",
> +                        default=igt_build_path)
> +    parser.add_argument("--gen-testlist",
> +                        help="Generate documentation at the GEN_TESTLIST directory, using SORT_FIELD to split the tests. Requires --sort-field.")
> +    parser.add_argument('--files', nargs='+',
> +                        help="File name(s) to be processed")
>  
> -tests = TestList(config_fname = parse_args.config,
> -                 include_plan = parse_args.include_plan,
> -                 file_list = parse_args.files,
> -                 igt_build_path = parse_args.igt_build_path)
> +    parse_args = parser.parse_args()
>  
> -if parse_args.filter_field:
> -    for filter_expr in parse_args.filter_field:
> -        tests.add_filter(filter_expr)
> +    tests = TestList(config_fname = parse_args.config,
> +                        include_plan = parse_args.include_plan,
> +                        file_list = parse_args.files,
> +                        igt_build_path = parse_args.igt_build_path)
>  
> -RUN = 0
> -if parse_args.show_subtests:
> -    RUN = 1
> -    tests.show_subtests(parse_args.sort_field)
> +    if parse_args.filter_field:
> +        for filter_expr in parse_args.filter_field:
> +            tests.add_filter(filter_expr)
>  
> -if parse_args.check_testlist:
> -    RUN = 1
> -    tests.check_tests()
> +    run = False
> +    if parse_args.show_subtests:
> +        run = True
> +        tests.show_subtests(parse_args.sort_field)
>  
> -if parse_args.gen_testlist:
> -    RUN = 1
> -    if not parse_args.sort_field:
> -        sys.exit("Need a field to split the testlists")
> -    tests.gen_testlist(parse_args.gen_testlist, parse_args.sort_field)
> +    if parse_args.check_testlist:
> +        run = True
> +        tests.check_tests()
>  
> -if parse_args.to_json:
> -    RUN = 1
> -    tests.print_json(parse_args.to_json)
> +    if parse_args.gen_testlist:
> +        run = True
> +        if not parse_args.sort_field:
> +            sys.exit("Need a field to split the testlists")
> +        tests.gen_testlist(parse_args.gen_testlist, parse_args.sort_field)
>  
> -if not RUN or parse_args.rest:
> -    if parse_args.per_test:
> -        tests.print_rest_flat(parse_args.rest)
> -    else:
> -        tests.print_nested_rest(parse_args.rest)
> +    if parse_args.to_json:
> +        run = True
> +        tests.print_json(parse_args.to_json)
> +
> +    if not run or parse_args.rest:
> +        if parse_args.per_test:
> +            tests.print_rest_flat(parse_args.rest)
> +        else:
> +            tests.print_nested_rest(parse_args.rest)
> +
> +if __name__ == '__main__':
> +    main()
> -- 
> 2.42.0
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-11-28 15:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-28 10:48 [igt-dev] [PATCH i-g-t 0/5] Do dome cleanups at IGT doc tools Mauro Carvalho Chehab
2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 1/5] scripts/test_list.py: better expand subtests Mauro Carvalho Chehab
2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 2/5] scripts/test_list.py: don't add a blank description Mauro Carvalho Chehab
2023-11-28 15:51   ` Kamil Konieczny
2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 3/5] scripts/test_list.py: Fix trivial pylint issues Mauro Carvalho Chehab
2023-11-28 15:44   ` Kamil Konieczny
2023-11-28 10:48 ` [igt-dev] [PATCH i-g-t 4/5] scripts/test_list.py: fix indent at get_subtests() Mauro Carvalho Chehab
2023-11-28 15:57   ` Kamil Konieczny
2023-11-28 10:49 ` [igt-dev] [PATCH i-g-t 5/5] igt_doc.py: move the main code to a main() function Mauro Carvalho Chehab
2023-11-28 15:59   ` Kamil Konieczny
2023-11-28 11:59 ` [igt-dev] ✓ CI.xeBAT: success for Do dome cleanups at IGT doc tools Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.