* [igt-dev] [PATCH i-g-t v4 01/11] scripts/test_list.py: make the class more generic
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 02/11] scripts/test_list.py: rename the internal summary value Mauro Carvalho Chehab
` (12 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Currently, the class is meant to be used only on IGT. However, it
could also be used on other projects. It actually makes sense to
port it to the Kernel, in order to document KUnit and Kselftests.
Make the class more generic by allowing the constructor to pass
three additional arguments:
- The tag name for the test group ("TEST");
- The tag name for the subtest group ("SUBTEST");
- the prefix name for the tests;
- the separator between testa and subtests.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 41 +++++++++++++++++++++++++++--------------
1 file changed, 27 insertions(+), 14 deletions(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index c23d6d735edf..f843c7a2a4f6 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -101,8 +101,8 @@ class TestList:
"""
Parse and handle test lists with test/subtest documentation, in the
- form of C comments, with two meta-tags (TEST and SUBTEST), and a set of
- `field: value` items:
+ form of C comments, with two meta-tags (by default, TEST and SUBTEST),
+ and a set of `field: value` items:
/**
* TEST: Check if new IGT test documentation logic functionality is working
@@ -246,7 +246,9 @@ class TestList:
"""
def __init__(self, config_fname, include_plan = False, file_list = False,
- igt_build_path = None):
+ igt_build_path = None,
+ test_tag = "TEST", subtest_tag = "SUBTESTS?",
+ main_name = "igt", subtest_separator = "@"):
self.doc = {}
self.test_number = 0
self.config = None
@@ -259,6 +261,11 @@ class TestList:
self.field_list = {}
self.title = None
self.filters = {}
+ self.subtest_separator = subtest_separator
+ self.main_name = main_name
+
+ if self.main_name:
+ self.main_name += subtest_separator
driver_name = re.sub(r'(.*/)?([^\/]+)/.*', r'\2', config_fname).capitalize()
@@ -355,11 +362,13 @@ class TestList:
if fname == '':
continue
- self.__add_file_documentation(fname, implemented_class, field_re)
+ self.__add_file_documentation(fname, implemented_class, field_re,
+ test_tag, subtest_tag)
if include_plan:
for fname in self.plan_filenames:
- self.__add_file_documentation(fname, planned_class, field_re)
+ self.__add_file_documentation(fname, planned_class, field_re,
+ test_tag, subtest_tag)
#
# ancillary methods
@@ -421,7 +430,7 @@ class TestList:
for subtest in self.doc[test]["subtest"].keys():
summary = test_name
if self.doc[test]["subtest"][subtest]["Summary"] != '':
- summary += '@' + self.doc[test]["subtest"][subtest]["Summary"]
+ summary += self.subtest_separator + self.doc[test]["subtest"][subtest]["Summary"]
if not summary:
continue
@@ -551,7 +560,7 @@ class TestList:
name = re.sub(r'.*/', '', fname)
name = re.sub(r'\.[\w+]$', '', name)
- name = "igt@" + name
+ name = self.main_name + name
if not subtest_only:
test_dict[name] = {}
@@ -606,7 +615,7 @@ class TestList:
name = re.sub(r'.*/', '', fname)
name = re.sub(r'\.[ch]', '', name)
- name = "igt@" + name
+ name = self.main_name + name
tmp_subtest = self.expand_subtest(fname, name, test, False)
@@ -844,7 +853,7 @@ class TestList:
test_name = re.sub(r'.*/', '', fname)
test_name = re.sub(r'\.[ch]', '', test_name)
- test_name = "igt@" + test_name
+ test_name = self.main_name + test_name
subtest_array += self.expand_subtest(fname, test_name, test, True)
@@ -949,7 +958,7 @@ class TestList:
subtests = self.expand_dictionary(True)
for subtest, data in sorted(subtests.items()):
- subtest = "@".join(subtest.split("@")[:3])
+ subtest = self.subtest_separator.join(subtest.split(self.subtest_separator)[:3])
subtest = args_regex.sub(r'\\d+', subtest)
for field in mandatory_fields:
@@ -1007,7 +1016,8 @@ class TestList:
# File handling methods
#
- def __add_file_documentation(self, fname, implemented_class, field_re):
+ def __add_file_documentation(self, fname, implemented_class, field_re,
+ test_tag, subtest_tag):
"""Adds the contents of test/subtest documentation form a file"""
@@ -1021,6 +1031,9 @@ class TestList:
cur_arg_element = 0
has_test_or_subtest = 0
+ test_regex = re.compile(test_tag + r':\s*(.*)')
+ subtest_regex = re.compile('^' + subtest_tag + r':\s*(.*)')
+
with open(fname, 'r', encoding='utf8') as handle:
arg_ref = None
current_test = ''
@@ -1055,7 +1068,7 @@ class TestList:
current_field = ''
# Check if it is a new TEST section
- match = re.match(r'^TEST:\s*(.*)', file_line)
+ match = test_regex.match(file_line)
if match:
has_test_or_subtest = 1
current_test = self.test_number
@@ -1077,7 +1090,7 @@ class TestList:
continue
# Check if it is a new SUBTEST section
- match = re.match(r'^SUBTESTS?:\s*(.*)', file_line)
+ match = subtest_regex.match(file_line)
if match:
has_test_or_subtest = 1
current_subtest = subtest_number
@@ -1242,7 +1255,7 @@ class TestList:
"""Generate testlists from the test documentation"""
test_prefix = os.path.commonprefix(self.get_subtests()[""])
- test_prefix = re.sub(r'^igt@', '', test_prefix)
+ test_prefix = re.sub(r'^' + self.main_name, '', test_prefix)
# NOTE: currently, it uses a comma for multi-value delimitter
test_subtests = self.get_subtests(sort_field, ",", with_order = True)
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [igt-dev] [PATCH i-g-t v4 02/11] scripts/test_list.py: rename the internal summary value
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 01/11] scripts/test_list.py: make the class " Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 03/11] scripts/test_list.py: document what BAT stands for Mauro Carvalho Chehab
` (11 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
The sumary is used internally. So, it is not meant to be used as
a normal field. To avoid possible clashes in the future, rename
the internal usage to _summary_, as we're using _foo_ for internal
properties.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index f843c7a2a4f6..415394c017b9 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -429,8 +429,8 @@ class TestList:
for subtest in self.doc[test]["subtest"].keys():
summary = test_name
- if self.doc[test]["subtest"][subtest]["Summary"] != '':
- summary += self.subtest_separator + self.doc[test]["subtest"][subtest]["Summary"]
+ if self.doc[test]["subtest"][subtest]["_summary_"] != '':
+ summary += self.subtest_separator + self.doc[test]["subtest"][subtest]["_summary_"]
if not summary:
continue
@@ -441,10 +441,10 @@ class TestList:
if num_vars == 0:
subtest_dict = {}
- subtest_dict["Summary"] = summary
+ subtest_dict["_summary_"] = summary
for k in sorted(self.doc[test]["subtest"][subtest].keys()):
- if k in [ 'Summary', 'arg', 'subtest_line' ]:
+ if k in [ '_summary_', 'arg', 'subtest_line' ]:
continue
if not allow_inherit:
@@ -510,10 +510,10 @@ class TestList:
# Store the element
subtest_dict = {}
- subtest_dict["Summary"] = arg_summary
+ subtest_dict["_summary_"] = arg_summary
for field in sorted(self.doc[test]["subtest"][subtest].keys()):
- if field in [ 'Summary', 'arg', 'subtest_line' ]:
+ if field in [ '_summary_', 'arg', 'subtest_line' ]:
continue
sub_field = self.doc[test]["subtest"][subtest][field]
@@ -581,11 +581,11 @@ class TestList:
if self.__filter_subtest(self.doc[test], subtest, True):
continue
- summary = subtest["Summary"]
+ summary = subtest["_summary_"]
dic[summary] = {}
for field in sorted(subtest.keys()):
- if field in [ 'Summary', 'arg', 'subtest_line' ]:
+ if field in [ '_summary_', 'arg', 'subtest_line' ]:
continue
dic[summary][field] = subtest[field]
@@ -646,12 +646,12 @@ class TestList:
for subtest in subtest_array:
print()
- print(subtest["Summary"])
- print(len(subtest["Summary"]) * '=')
+ print(subtest["_summary_"])
+ print(len(subtest["_summary_"]) * '=')
print("")
for field in sorted(subtest.keys()):
- if field in [ 'Summary', 'arg', 'subtest_line' ]:
+ if field in [ '_summary_', 'arg', 'subtest_line' ]:
continue
print(f":{field}:", subtest[field])
@@ -857,7 +857,7 @@ 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):
@@ -873,27 +873,27 @@ class TestList:
if test_elem not in subtests:
subtests[test_elem] = []
if order:
- subtests[test_elem].append((subtest["Summary"], test_list))
+ subtests[test_elem].append((subtest["_summary_"], test_list))
else:
- subtests[test_elem].append(subtest["Summary"])
+ 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]]))
+ subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
else:
- subtests[subtest[sort_field]].append(subtest["Summary"])
+ subtests[subtest[sort_field]].append(subtest["_summary_"])
else:
if order:
- subtests[test_elem].append((subtest["Summary"], [subtest[sort_field]]))
+ subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
else:
- subtests[""].append(subtest["Summary"])
+ subtests[""].append(subtest["_summary_"])
else:
if order:
- subtests[test_elem].append((subtest["Summary"], [subtest[sort_field]]))
+ subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
else:
- subtests[""].append(subtest["Summary"])
+ subtests[""].append(subtest["_summary_"])
if order:
for group, tests in subtests.items():
@@ -1078,7 +1078,7 @@ class TestList:
self.doc[current_test] = {}
self.doc[current_test]["arg"] = {}
- self.doc[current_test]["Summary"] = match.group(1)
+ self.doc[current_test]["_summary_"] = match.group(1)
self.doc[current_test]["File"] = fname
self.doc[current_test]["subtest"] = {}
self.doc[current_test]["subtest_line"] = {}
@@ -1116,7 +1116,7 @@ class TestList:
continue
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]["_summary_"] = match.group(1)
self.doc[current_test]["subtest"][current_subtest]["Description"] = ''
self.doc[current_test]["subtest_line"][current_subtest] = file_ln
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [igt-dev] [PATCH i-g-t v4 03/11] scripts/test_list.py: document what BAT stands for
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 01/11] scripts/test_list.py: make the class " Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 02/11] scripts/test_list.py: rename the internal summary value Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 04/11] scripts/test_list.py: close config file before start processing Mauro Carvalho Chehab
` (10 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
BAT means Basic Accetance Test, which is a set of tests that
are meant to test basic functionalities and provide a fast
feedback. Add some documentation where the term is present
at the code.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index 415394c017b9..54ccb6d1c0cd 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -1270,7 +1270,7 @@ class TestList:
testlist = test.lower()
if testlist == "":
fname = "other"
- elif testlist == "bat":
+ elif testlist == "bat": # Basic Acceptance Test
fname = "fast-feedback"
else:
fname = testlist
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [igt-dev] [PATCH i-g-t v4 04/11] scripts/test_list.py: close config file before start processing
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (2 preceding siblings ...)
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 03/11] scripts/test_list.py: document what BAT stands for Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 17:13 ` Kamil Konieczny
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 05/11] scripts/test_list.py: filename arguments for print_ methods are optional Mauro Carvalho Chehab
` (9 subsequent siblings)
13 siblings, 1 reply; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Reduce the identation level of the code which parses the config
file, as this can be done after closing the file.
This is a preparation for the next patch that will offer a different
way to pass the configuration.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 114 +++++++++++++++++++++----------------------
1 file changed, 57 insertions(+), 57 deletions(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index 54ccb6d1c0cd..d0d56954b010 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -274,71 +274,71 @@ class TestList:
with open(config_fname, 'r', encoding='utf8') as handle:
self.config = json.load(handle)
- self.__add_field(None, 0, 0, self.config["fields"])
+ self.__add_field(None, 0, 0, self.config["fields"])
- sublevel_count = [ 0 ] * self.level_count
+ sublevel_count = [ 0 ] * self.level_count
- for field, item in self.props.items():
- if "sublevel" in item["_properties_"]:
- level = item["_properties_"]["level"]
- sublevel = item["_properties_"]["sublevel"]
- if sublevel > sublevel_count[level - 1]:
- sublevel_count[level - 1] = sublevel
+ for field, item in self.props.items():
+ if "sublevel" in item["_properties_"]:
+ level = item["_properties_"]["level"]
+ sublevel = item["_properties_"]["sublevel"]
+ if sublevel > sublevel_count[level - 1]:
+ sublevel_count[level - 1] = sublevel
- field_lc = field.lower()
- self.field_list[field_lc] = field
- field_plural = _plural(field_lc)
- if field_lc != field_plural:
- self.field_list[field_plural] = field
+ field_lc = field.lower()
+ self.field_list[field_lc] = field
+ field_plural = _plural(field_lc)
+ if field_lc != field_plural:
+ self.field_list[field_plural] = field
- if include_plan:
- self.props["Class"] = {}
- self.props["Class"]["_properties_"] = {}
- self.props["Class"]["_properties_"]["level"] = 1
- self.props["Class"]["_properties_"]["sublevel"] = sublevel_count[0] + 1
+ if include_plan:
+ self.props["Class"] = {}
+ self.props["Class"]["_properties_"] = {}
+ self.props["Class"]["_properties_"]["level"] = 1
+ self.props["Class"]["_properties_"]["sublevel"] = sublevel_count[0] + 1
- # Remove non-multilevel items, as we're only interested on
- # hierarchical item levels here
- for field, item in self.props.items():
- if "sublevel" in item["_properties_"]:
- level = item["_properties_"]["level"]
- if sublevel_count[level - 1] == 1:
- del item["_properties_"]["level"]
- del item["_properties_"]["sublevel"]
- del self.props["_properties_"]
+ # Remove non-multilevel items, as we're only interested on
+ # hierarchical item levels here
+ for field, item in self.props.items():
+ if "sublevel" in item["_properties_"]:
+ level = item["_properties_"]["level"]
+ if sublevel_count[level - 1] == 1:
+ del item["_properties_"]["level"]
+ del item["_properties_"]["sublevel"]
+ del self.props["_properties_"]
- has_implemented = False
- if not self.filenames:
- self.filenames = []
- exclude_files = []
- files = self.config["files"]
- exclude_file_glob = self.config.get("exclude_files", [])
- for cfg_file in exclude_file_glob:
- cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
- for fname in glob.glob(cfg_file):
- exclude_files.append(fname)
+ has_implemented = False
+ if not self.filenames:
+ self.filenames = []
+ exclude_files = []
+ files = self.config["files"]
+ exclude_file_glob = self.config.get("exclude_files", [])
+ for cfg_file in exclude_file_glob:
+ cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
+ for fname in glob.glob(cfg_file):
+ exclude_files.append(fname)
- for cfg_file in files:
- cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
- for fname in glob.glob(cfg_file):
- if fname in exclude_files:
- continue
- self.filenames.append(fname)
- has_implemented = True
- else:
- for cfg_file in self.filenames:
- if cfg_file:
- has_implemented = True
+ for cfg_file in files:
+ cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
+ for fname in glob.glob(cfg_file):
+ if fname in exclude_files:
+ continue
+ self.filenames.append(fname)
+ has_implemented = True
+ else:
+ for cfg_file in self.filenames:
+ if cfg_file:
+ has_implemented = True
- has_planned = False
- if include_plan and "planning_files" in self.config:
- implemented_class = "Implemented"
- files = self.config["planning_files"]
- for cfg_file in files:
- cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
- for fname in glob.glob(cfg_file):
- self.plan_filenames.append(fname)
- has_planned = True
+ has_planned = False
+ if include_plan and "planning_files" in self.config:
+ implemented_class = "Implemented"
+ files = self.config["planning_files"]
+ for cfg_file in files:
+ cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
+ for fname in glob.glob(cfg_file):
+ self.plan_filenames.append(fname)
+ has_planned = True
planned_class = None
if has_implemented:
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [igt-dev] [PATCH i-g-t v4 04/11] scripts/test_list.py: close config file before start processing
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 04/11] scripts/test_list.py: close config file before start processing Mauro Carvalho Chehab
@ 2023-08-31 17:13 ` Kamil Konieczny
0 siblings, 0 replies; 18+ messages in thread
From: Kamil Konieczny @ 2023-08-31 17:13 UTC (permalink / raw)
To: igt-dev
Hi Mauro,
On 2023-08-31 at 16:52:06 +0200, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab@kernel.org>
>
> Reduce the identation level of the code which parses the config
> file, as this can be done after closing the file.
>
> This is a preparation for the next patch that will offer a different
> way to pass the configuration.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
> scripts/test_list.py | 114 +++++++++++++++++++++----------------------
> 1 file changed, 57 insertions(+), 57 deletions(-)
>
> diff --git a/scripts/test_list.py b/scripts/test_list.py
> index 54ccb6d1c0cd..d0d56954b010 100755
> --- a/scripts/test_list.py
> +++ b/scripts/test_list.py
> @@ -274,71 +274,71 @@ class TestList:
> with open(config_fname, 'r', encoding='utf8') as handle:
> self.config = json.load(handle)
>
> - self.__add_field(None, 0, 0, self.config["fields"])
> + self.__add_field(None, 0, 0, self.config["fields"])
>
> - sublevel_count = [ 0 ] * self.level_count
> + sublevel_count = [ 0 ] * self.level_count
>
> - for field, item in self.props.items():
> - if "sublevel" in item["_properties_"]:
> - level = item["_properties_"]["level"]
> - sublevel = item["_properties_"]["sublevel"]
> - if sublevel > sublevel_count[level - 1]:
> - sublevel_count[level - 1] = sublevel
> + for field, item in self.props.items():
> + if "sublevel" in item["_properties_"]:
> + level = item["_properties_"]["level"]
> + sublevel = item["_properties_"]["sublevel"]
> + if sublevel > sublevel_count[level - 1]:
> + sublevel_count[level - 1] = sublevel
>
> - field_lc = field.lower()
> - self.field_list[field_lc] = field
> - field_plural = _plural(field_lc)
> - if field_lc != field_plural:
> - self.field_list[field_plural] = field
> + field_lc = field.lower()
> + self.field_list[field_lc] = field
> + field_plural = _plural(field_lc)
> + if field_lc != field_plural:
> + self.field_list[field_plural] = field
>
> - if include_plan:
> - self.props["Class"] = {}
> - self.props["Class"]["_properties_"] = {}
> - self.props["Class"]["_properties_"]["level"] = 1
> - self.props["Class"]["_properties_"]["sublevel"] = sublevel_count[0] + 1
> + if include_plan:
> + self.props["Class"] = {}
> + self.props["Class"]["_properties_"] = {}
> + self.props["Class"]["_properties_"]["level"] = 1
> + self.props["Class"]["_properties_"]["sublevel"] = sublevel_count[0] + 1
>
> - # Remove non-multilevel items, as we're only interested on
> - # hierarchical item levels here
> - for field, item in self.props.items():
> - if "sublevel" in item["_properties_"]:
> - level = item["_properties_"]["level"]
> - if sublevel_count[level - 1] == 1:
> - del item["_properties_"]["level"]
> - del item["_properties_"]["sublevel"]
> - del self.props["_properties_"]
> + # Remove non-multilevel items, as we're only interested on
> + # hierarchical item levels here
> + for field, item in self.props.items():
> + if "sublevel" in item["_properties_"]:
> + level = item["_properties_"]["level"]
> + if sublevel_count[level - 1] == 1:
> + del item["_properties_"]["level"]
> + del item["_properties_"]["sublevel"]
> + del self.props["_properties_"]
>
> - has_implemented = False
> - if not self.filenames:
> - self.filenames = []
> - exclude_files = []
> - files = self.config["files"]
> - exclude_file_glob = self.config.get("exclude_files", [])
> - for cfg_file in exclude_file_glob:
> - cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
> - for fname in glob.glob(cfg_file):
> - exclude_files.append(fname)
> + has_implemented = False
> + if not self.filenames:
> + self.filenames = []
> + exclude_files = []
> + files = self.config["files"]
> + exclude_file_glob = self.config.get("exclude_files", [])
> + for cfg_file in exclude_file_glob:
> + cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
> + for fname in glob.glob(cfg_file):
> + exclude_files.append(fname)
>
> - for cfg_file in files:
> - cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
> - for fname in glob.glob(cfg_file):
> - if fname in exclude_files:
> - continue
> - self.filenames.append(fname)
> - has_implemented = True
> - else:
> - for cfg_file in self.filenames:
> - if cfg_file:
> - has_implemented = True
> + for cfg_file in files:
> + cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
> + for fname in glob.glob(cfg_file):
> + if fname in exclude_files:
> + continue
> + self.filenames.append(fname)
> + has_implemented = True
> + else:
> + for cfg_file in self.filenames:
> + if cfg_file:
> + has_implemented = True
>
> - has_planned = False
> - if include_plan and "planning_files" in self.config:
> - implemented_class = "Implemented"
> - files = self.config["planning_files"]
> - for cfg_file in files:
> - cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
> - for fname in glob.glob(cfg_file):
> - self.plan_filenames.append(fname)
> - has_planned = True
> + has_planned = False
> + if include_plan and "planning_files" in self.config:
> + implemented_class = "Implemented"
> + files = self.config["planning_files"]
> + for cfg_file in files:
> + cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
> + for fname in glob.glob(cfg_file):
> + self.plan_filenames.append(fname)
> + has_planned = True
>
> planned_class = None
> if has_implemented:
> --
> 2.41.0
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [igt-dev] [PATCH i-g-t v4 05/11] scripts/test_list.py: filename arguments for print_ methods are optional
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (3 preceding siblings ...)
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 04/11] scripts/test_list.py: close config file before start processing Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 06/11] scripts/test_list.py: add a check before deleting properties Mauro Carvalho Chehab
` (8 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Add a default to those, as the code doesn't need any arguments.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index d0d56954b010..9ab33f15d970 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -595,7 +595,7 @@ class TestList:
# Output methods
#
- def print_rest_flat(self, filename):
+ def print_rest_flat(self, filename = None):
"""Print tests and subtests ordered by tests"""
@@ -707,7 +707,7 @@ class TestList:
sheet[row].append('')
return sheet
- def print_nested_rest(self, filename):
+ def print_nested_rest(self, filename = None):
"""Print tests and subtests ordered by tests"""
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [igt-dev] [PATCH i-g-t v4 06/11] scripts/test_list.py: add a check before deleting properties
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (4 preceding siblings ...)
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 05/11] scripts/test_list.py: filename arguments for print_ methods are optional Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 07/11] scripts/test_list.py: skip some internal fields Mauro Carvalho Chehab
` (7 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
If the config file doesn't have empty _properties_, the current
logic causes an error. Well, if one is passing a dictionary via
config_dict, it may end using a simplified dict without any
_properties_ on it.
Add an extra check to avoid an error.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index 9ab33f15d970..753ec91206cd 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -305,7 +305,8 @@ class TestList:
if sublevel_count[level - 1] == 1:
del item["_properties_"]["level"]
del item["_properties_"]["sublevel"]
- del self.props["_properties_"]
+ if "_properties_" in self.props:
+ del self.props["_properties_"]
has_implemented = False
if not self.filenames:
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [igt-dev] [PATCH i-g-t v4 07/11] scripts/test_list.py: skip some internal fields
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (5 preceding siblings ...)
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 06/11] scripts/test_list.py: add a check before deleting properties Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 17:16 ` Kamil Konieczny
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 08/11] scripts/test_list.py: add support to return a string instead of print Mauro Carvalho Chehab
` (6 subsequent siblings)
13 siblings, 1 reply; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
both subtest_line and _summary_ are used internally at the script
logic. They shouldn't be part of the output.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 68 +++++++++++++++++++++-----------------------
1 file changed, 33 insertions(+), 35 deletions(-)
mode change 100755 => 100644 scripts/test_list.py
diff --git a/scripts/test_list.py b/scripts/test_list.py
old mode 100755
new mode 100644
index 753ec91206cd..e5bf24f9b5ef
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -264,6 +264,8 @@ class TestList:
self.subtest_separator = subtest_separator
self.main_name = main_name
+ self.internal_fields = [ '_summary_', '_arg_', '_subtest_line_' ]
+
if self.main_name:
self.main_name += subtest_separator
@@ -436,7 +438,7 @@ class TestList:
continue
num_vars = summary.count('%')
- file_ln = self.doc[test]["subtest_line"][subtest]
+ file_ln = self.doc[test]["_subtest_line_"][subtest]
# Handle trivial case: no wildcards
if num_vars == 0:
@@ -445,7 +447,7 @@ class TestList:
subtest_dict["_summary_"] = summary
for k in sorted(self.doc[test]["subtest"][subtest].keys()):
- if k in [ '_summary_', 'arg', 'subtest_line' ]:
+ if k in self.internal_fields:
continue
if not allow_inherit:
@@ -468,14 +470,14 @@ class TestList:
# Convert subtest arguments into an array
arg_array = {}
- arg_ref = self.doc[test]["subtest"][subtest]["arg"]
+ arg_ref = self.doc[test]["subtest"][subtest]["_arg_"]
- for arg_k in self.doc[test]["arg"][arg_ref].keys():
+ for arg_k in self.doc[test]["_arg_"][arg_ref].keys():
arg_array[arg_k] = []
if int(arg_k) > num_vars:
continue
- for arg_el in sorted(self.doc[test]["arg"][arg_ref][arg_k].keys()):
+ for arg_el in sorted(self.doc[test]["_arg_"][arg_ref][arg_k].keys()):
arg_array[arg_k].append(arg_el)
size = len(arg_array)
@@ -500,9 +502,9 @@ class TestList:
arg_val = arg_array[j][pos[j]]
args[j] = arg_val
- if arg_val in self.doc[test]["arg"][arg_ref][j]:
- arg_map[j] = self.doc[test]["arg"][arg_ref][j][arg_val]
- if re.match(r"\<.*\>", self.doc[test]["arg"][arg_ref][j][arg_val]):
+ if arg_val in self.doc[test]["_arg_"][arg_ref][j]:
+ arg_map[j] = self.doc[test]["_arg_"][arg_ref][j][arg_val]
+ if re.match(r"\<.*\>", self.doc[test]["_arg_"][arg_ref][j][arg_val]):
args[j] = "<" + arg_val + ">"
else:
arg_map[j] = arg_val
@@ -514,7 +516,7 @@ class TestList:
subtest_dict["_summary_"] = arg_summary
for field in sorted(self.doc[test]["subtest"][subtest].keys()):
- if field in [ '_summary_', 'arg', 'subtest_line' ]:
+ if field in self.internal_fields:
continue
sub_field = self.doc[test]["subtest"][subtest][field]
@@ -567,9 +569,7 @@ class TestList:
test_dict[name] = {}
for field in self.doc[test]:
- if field == "subtest":
- continue
- if field == "arg":
+ if field in self.internal_fields:
continue
test_dict[name][field] = self.doc[test][field]
@@ -586,7 +586,7 @@ class TestList:
dic[summary] = {}
for field in sorted(subtest.keys()):
- if field in [ '_summary_', 'arg', 'subtest_line' ]:
+ if field in self.internal_fields:
continue
dic[summary][field] = subtest[field]
@@ -639,7 +639,7 @@ class TestList:
for field in sorted(self.doc[test].keys()):
if field == "subtest":
continue
- if field == "arg":
+ if field in self.internal_fields:
continue
print(f":{field}: {self.doc[test][field]}")
@@ -652,7 +652,7 @@ class TestList:
print("")
for field in sorted(subtest.keys()):
- if field in [ '_summary_', 'arg', 'subtest_line' ]:
+ if field in self.internal_fields:
continue
print(f":{field}:", subtest[field])
@@ -1078,11 +1078,11 @@ class TestList:
handle_section = 'test'
self.doc[current_test] = {}
- self.doc[current_test]["arg"] = {}
+ self.doc[current_test]["_arg_"] = {}
self.doc[current_test]["_summary_"] = match.group(1)
self.doc[current_test]["File"] = fname
self.doc[current_test]["subtest"] = {}
- self.doc[current_test]["subtest_line"] = {}
+ self.doc[current_test]["_subtest_line_"] = {}
if implemented_class:
self.doc[current_test]["Class"] = implemented_class
@@ -1103,9 +1103,7 @@ class TestList:
# subtests inherit properties from the tests
self.doc[current_test]["subtest"][current_subtest] = {}
for field in self.doc[current_test].keys():
- if field == "arg":
- continue
- if field == "summary":
+ if field in self.internal_fields:
continue
if field == "File":
continue
@@ -1119,14 +1117,14 @@ class TestList:
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
+ self.doc[current_test]["_subtest_line_"][current_subtest] = file_ln
if not arg_ref:
arg_ref = arg_number
arg_number += 1
- self.doc[current_test]["arg"][arg_ref] = {}
+ self.doc[current_test]["_arg_"][arg_ref] = {}
- self.doc[current_test]["subtest"][current_subtest]["arg"] = arg_ref
+ self.doc[current_test]["subtest"][current_subtest]["_arg_"] = arg_ref
continue
@@ -1156,14 +1154,14 @@ class TestList:
sys.exit(f"{fname}:{file_ln + 1}: arguments should be defined after one or more subtests, at the same comment")
cur_arg = int(match.group(1)) - 1
- if cur_arg not in self.doc[current_test]["arg"][arg_ref]:
- self.doc[current_test]["arg"][arg_ref][cur_arg] = {}
+ if cur_arg not in self.doc[current_test]["_arg_"][arg_ref]:
+ self.doc[current_test]["_arg_"][arg_ref][cur_arg] = {}
cur_arg_element = match.group(2)
if match.group(2):
# Should be used only for numeric values
- self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] = "<" + match.group(2) + ">"
+ self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] = "<" + match.group(2) + ">"
continue
@@ -1175,7 +1173,7 @@ class TestList:
sys.exit(f"{fname}:{file_ln + 1}: arguments should be defined after one or more subtests, at the same comment")
cur_arg_element = match.group(1)
- self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] = match.group(2)
+ self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] = match.group(2)
else:
print(f"{fname}:{file_ln + 1}: Warning: invalid argument: @%s: %s" %
@@ -1188,14 +1186,14 @@ class TestList:
if match:
cur_arg = int(match.group(1)) - 1
- if cur_arg not in self.doc[current_test]["arg"][arg_ref]:
- self.doc[current_test]["arg"][arg_ref][cur_arg] = {}
+ if cur_arg not in self.doc[current_test]["_arg_"][arg_ref]:
+ self.doc[current_test]["_arg_"][arg_ref][cur_arg] = {}
values = match.group(2).replace(" ", "").split(",")
for split_val in values:
if split_val == "":
continue
- self.doc[current_test]["arg"][arg_ref][cur_arg][split_val] = split_val
+ self.doc[current_test]["_arg_"][arg_ref][cur_arg][split_val] = split_val
continue
@@ -1219,13 +1217,13 @@ class TestList:
if match:
match_val = match.group(1)
- match = re.match(r'^(\<.*)\>$',self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element])
+ match = re.match(r'^(\<.*)\>$',self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element])
if match:
- self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] = match.group(1) + ' ' + match_val + ">"
+ self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] = match.group(1) + ' ' + match_val + ">"
else:
- if self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] != '':
- self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] += ' '
- self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] += match_val
+ if self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] != '':
+ self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] += ' '
+ self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] += match_val
continue
file_line.rstrip(r"\n")
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [igt-dev] [PATCH i-g-t v4 07/11] scripts/test_list.py: skip some internal fields
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 07/11] scripts/test_list.py: skip some internal fields Mauro Carvalho Chehab
@ 2023-08-31 17:16 ` Kamil Konieczny
0 siblings, 0 replies; 18+ messages in thread
From: Kamil Konieczny @ 2023-08-31 17:16 UTC (permalink / raw)
To: igt-dev
Hi Mauro,
On 2023-08-31 at 16:52:09 +0200, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab@kernel.org>
>
> both subtest_line and _summary_ are used internally at the script
- ^
Start from uppercase, with that fixed:
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> logic. They shouldn't be part of the output.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
> ---
> scripts/test_list.py | 68 +++++++++++++++++++++-----------------------
> 1 file changed, 33 insertions(+), 35 deletions(-)
> mode change 100755 => 100644 scripts/test_list.py
>
> diff --git a/scripts/test_list.py b/scripts/test_list.py
> old mode 100755
> new mode 100644
> index 753ec91206cd..e5bf24f9b5ef
> --- a/scripts/test_list.py
> +++ b/scripts/test_list.py
> @@ -264,6 +264,8 @@ class TestList:
> self.subtest_separator = subtest_separator
> self.main_name = main_name
>
> + self.internal_fields = [ '_summary_', '_arg_', '_subtest_line_' ]
> +
> if self.main_name:
> self.main_name += subtest_separator
>
> @@ -436,7 +438,7 @@ class TestList:
> continue
>
> num_vars = summary.count('%')
> - file_ln = self.doc[test]["subtest_line"][subtest]
> + file_ln = self.doc[test]["_subtest_line_"][subtest]
>
> # Handle trivial case: no wildcards
> if num_vars == 0:
> @@ -445,7 +447,7 @@ class TestList:
> subtest_dict["_summary_"] = summary
>
> for k in sorted(self.doc[test]["subtest"][subtest].keys()):
> - if k in [ '_summary_', 'arg', 'subtest_line' ]:
> + if k in self.internal_fields:
> continue
>
> if not allow_inherit:
> @@ -468,14 +470,14 @@ class TestList:
>
> # Convert subtest arguments into an array
> arg_array = {}
> - arg_ref = self.doc[test]["subtest"][subtest]["arg"]
> + arg_ref = self.doc[test]["subtest"][subtest]["_arg_"]
>
> - for arg_k in self.doc[test]["arg"][arg_ref].keys():
> + for arg_k in self.doc[test]["_arg_"][arg_ref].keys():
> arg_array[arg_k] = []
> if int(arg_k) > num_vars:
> continue
>
> - for arg_el in sorted(self.doc[test]["arg"][arg_ref][arg_k].keys()):
> + for arg_el in sorted(self.doc[test]["_arg_"][arg_ref][arg_k].keys()):
> arg_array[arg_k].append(arg_el)
>
> size = len(arg_array)
> @@ -500,9 +502,9 @@ class TestList:
> arg_val = arg_array[j][pos[j]]
> args[j] = arg_val
>
> - if arg_val in self.doc[test]["arg"][arg_ref][j]:
> - arg_map[j] = self.doc[test]["arg"][arg_ref][j][arg_val]
> - if re.match(r"\<.*\>", self.doc[test]["arg"][arg_ref][j][arg_val]):
> + if arg_val in self.doc[test]["_arg_"][arg_ref][j]:
> + arg_map[j] = self.doc[test]["_arg_"][arg_ref][j][arg_val]
> + if re.match(r"\<.*\>", self.doc[test]["_arg_"][arg_ref][j][arg_val]):
> args[j] = "<" + arg_val + ">"
> else:
> arg_map[j] = arg_val
> @@ -514,7 +516,7 @@ class TestList:
> subtest_dict["_summary_"] = arg_summary
>
> for field in sorted(self.doc[test]["subtest"][subtest].keys()):
> - if field in [ '_summary_', 'arg', 'subtest_line' ]:
> + if field in self.internal_fields:
> continue
>
> sub_field = self.doc[test]["subtest"][subtest][field]
> @@ -567,9 +569,7 @@ class TestList:
> test_dict[name] = {}
>
> for field in self.doc[test]:
> - if field == "subtest":
> - continue
> - if field == "arg":
> + if field in self.internal_fields:
> continue
>
> test_dict[name][field] = self.doc[test][field]
> @@ -586,7 +586,7 @@ class TestList:
>
> dic[summary] = {}
> for field in sorted(subtest.keys()):
> - if field in [ '_summary_', 'arg', 'subtest_line' ]:
> + if field in self.internal_fields:
> continue
> dic[summary][field] = subtest[field]
>
> @@ -639,7 +639,7 @@ class TestList:
> for field in sorted(self.doc[test].keys()):
> if field == "subtest":
> continue
> - if field == "arg":
> + if field in self.internal_fields:
> continue
>
> print(f":{field}: {self.doc[test][field]}")
> @@ -652,7 +652,7 @@ class TestList:
> print("")
>
> for field in sorted(subtest.keys()):
> - if field in [ '_summary_', 'arg', 'subtest_line' ]:
> + if field in self.internal_fields:
> continue
>
> print(f":{field}:", subtest[field])
> @@ -1078,11 +1078,11 @@ class TestList:
> handle_section = 'test'
>
> self.doc[current_test] = {}
> - self.doc[current_test]["arg"] = {}
> + self.doc[current_test]["_arg_"] = {}
> self.doc[current_test]["_summary_"] = match.group(1)
> self.doc[current_test]["File"] = fname
> self.doc[current_test]["subtest"] = {}
> - self.doc[current_test]["subtest_line"] = {}
> + self.doc[current_test]["_subtest_line_"] = {}
>
> if implemented_class:
> self.doc[current_test]["Class"] = implemented_class
> @@ -1103,9 +1103,7 @@ class TestList:
> # subtests inherit properties from the tests
> self.doc[current_test]["subtest"][current_subtest] = {}
> for field in self.doc[current_test].keys():
> - if field == "arg":
> - continue
> - if field == "summary":
> + if field in self.internal_fields:
> continue
> if field == "File":
> continue
> @@ -1119,14 +1117,14 @@ class TestList:
>
> 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
> + self.doc[current_test]["_subtest_line_"][current_subtest] = file_ln
>
> if not arg_ref:
> arg_ref = arg_number
> arg_number += 1
> - self.doc[current_test]["arg"][arg_ref] = {}
> + self.doc[current_test]["_arg_"][arg_ref] = {}
>
> - self.doc[current_test]["subtest"][current_subtest]["arg"] = arg_ref
> + self.doc[current_test]["subtest"][current_subtest]["_arg_"] = arg_ref
>
> continue
>
> @@ -1156,14 +1154,14 @@ class TestList:
> sys.exit(f"{fname}:{file_ln + 1}: arguments should be defined after one or more subtests, at the same comment")
>
> cur_arg = int(match.group(1)) - 1
> - if cur_arg not in self.doc[current_test]["arg"][arg_ref]:
> - self.doc[current_test]["arg"][arg_ref][cur_arg] = {}
> + if cur_arg not in self.doc[current_test]["_arg_"][arg_ref]:
> + self.doc[current_test]["_arg_"][arg_ref][cur_arg] = {}
>
> cur_arg_element = match.group(2)
>
> if match.group(2):
> # Should be used only for numeric values
> - self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] = "<" + match.group(2) + ">"
> + self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] = "<" + match.group(2) + ">"
>
> continue
>
> @@ -1175,7 +1173,7 @@ class TestList:
> sys.exit(f"{fname}:{file_ln + 1}: arguments should be defined after one or more subtests, at the same comment")
>
> cur_arg_element = match.group(1)
> - self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] = match.group(2)
> + self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] = match.group(2)
>
> else:
> print(f"{fname}:{file_ln + 1}: Warning: invalid argument: @%s: %s" %
> @@ -1188,14 +1186,14 @@ class TestList:
> if match:
> cur_arg = int(match.group(1)) - 1
>
> - if cur_arg not in self.doc[current_test]["arg"][arg_ref]:
> - self.doc[current_test]["arg"][arg_ref][cur_arg] = {}
> + if cur_arg not in self.doc[current_test]["_arg_"][arg_ref]:
> + self.doc[current_test]["_arg_"][arg_ref][cur_arg] = {}
>
> values = match.group(2).replace(" ", "").split(",")
> for split_val in values:
> if split_val == "":
> continue
> - self.doc[current_test]["arg"][arg_ref][cur_arg][split_val] = split_val
> + self.doc[current_test]["_arg_"][arg_ref][cur_arg][split_val] = split_val
>
> continue
>
> @@ -1219,13 +1217,13 @@ class TestList:
> if match:
> match_val = match.group(1)
>
> - match = re.match(r'^(\<.*)\>$',self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element])
> + match = re.match(r'^(\<.*)\>$',self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element])
> if match:
> - self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] = match.group(1) + ' ' + match_val + ">"
> + self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] = match.group(1) + ' ' + match_val + ">"
> else:
> - if self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] != '':
> - self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] += ' '
> - self.doc[current_test]["arg"][arg_ref][cur_arg][cur_arg_element] += match_val
> + if self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] != '':
> + self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] += ' '
> + self.doc[current_test]["_arg_"][arg_ref][cur_arg][cur_arg_element] += match_val
> continue
>
> file_line.rstrip(r"\n")
> --
> 2.41.0
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [igt-dev] [PATCH i-g-t v4 08/11] scripts/test_list.py: add support to return a string instead of print
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (6 preceding siblings ...)
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 07/11] scripts/test_list.py: skip some internal fields Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 17:17 ` Kamil Konieczny
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 09/11] scripts/test_list.py: don't rely on file name to parse config Mauro Carvalho Chehab
` (5 subsequent siblings)
13 siblings, 1 reply; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Sometimes, we don't want to print a testlist, but instead to return
it for post-processing. One such example is to add a Sphinx extension
to parse it and place the results on some existing ReST file.
Add support for it.
A side effect is that we don't need to redirect capture anymore to
to store the output on a file.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 79 ++++++++++++++++++++------------------------
1 file changed, 36 insertions(+), 43 deletions(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index e5bf24f9b5ef..8ef3a136688f 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -596,20 +596,13 @@ class TestList:
# Output methods
#
- def print_rest_flat(self, filename = None):
+ def print_rest_flat(self, filename = None, return_string = False):
"""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
-
- print("=" * len(self.title))
- print(self.title)
- print("=" * len(self.title))
- print()
+ out = "=" * len(self.title) + "\n"
+ out += self.title + "\n"
+ out += "=" * len(self.title) + "\n\n"
for test in sorted(self.doc.keys()):
fname = self.doc[test]["File"]
@@ -631,10 +624,9 @@ class TestList:
if not subtest_array:
continue
- print(len(name) * '=')
- print(name)
- print(len(name) * '=')
- print()
+ out += len(name) * '=' + "\n"
+ out += name + "\n"
+ out += len(name) * '=' + "\n\n"
for field in sorted(self.doc[test].keys()):
if field == "subtest":
@@ -642,29 +634,30 @@ class TestList:
if field in self.internal_fields:
continue
- print(f":{field}: {self.doc[test][field]}")
+ out += f":{field}: {self.doc[test][field]}\n"
for subtest in subtest_array:
- print()
- print(subtest["_summary_"])
- print(len(subtest["_summary_"]) * '=')
- print("")
+ out += "\n" + subtest["_summary_"] + "\n"
+ out += len(subtest["_summary_"]) * '=' + "\n\n"
for field in sorted(subtest.keys()):
if field in self.internal_fields:
continue
- print(f":{field}:", subtest[field])
+ out += f":{field}:" + subtest[field] + "\n"
- print()
+ out += "\n"
- print()
- print()
+ out += "\n\n"
- if handler:
- handler.close()
- sys.stdout = original_stdout
+ if filename:
+ with open(filename, "w", encoding='utf8') as handle:
+ handle.write(out)
+ elif not return_string:
+ print(out)
+ else:
+ return out
def get_spreadsheet(self):
@@ -708,7 +701,7 @@ class TestList:
sheet[row].append('')
return sheet
- def print_nested_rest(self, filename = None):
+ def print_nested_rest(self, filename = None, return_string = False):
"""Print tests and subtests ordered by tests"""
@@ -718,10 +711,9 @@ class TestList:
handler = open(filename, "w", encoding='utf8') # pylint: disable=R1732
sys.stdout = handler
- print("=" * len(self.title))
- print(self.title)
- print("=" * len(self.title))
- print()
+ out = "=" * len(self.title) + "\n"
+ out += self.title + "\n"
+ out += "=" * len(self.title) + "\n\n"
# Identify the sort order for the fields
fields_order = []
@@ -765,14 +757,11 @@ class TestList:
title_str = fields_order[i] + ": " + fields[fields_order[i]]
- print(title_str)
- print(level_markers[marker] * len(title_str))
- print()
+ out += title_str + "\n"
+ out += level_markers[marker] * len(title_str) + "\n\n"
marker += 1
- print()
- print("``" + subtest + "``")
- print()
+ out += "\n``" + subtest + "``" + "\n\n"
# print non-hierarchy fields
for field in fields_order:
@@ -780,7 +769,7 @@ class TestList:
continue
if field in fields:
- print(f":{field}: {fields[field]}")
+ out += f":{field}: {fields[field]}" + "\n"
# Store current values
for i in range(cur_level, len(fields_order)):
@@ -792,11 +781,15 @@ class TestList:
else:
old_fields[i] = ''
- print()
+ out += "\n"
- if handler:
- handler.close()
- sys.stdout = original_stdout
+ if filename:
+ with open(filename, "w", encoding='utf8') as handle:
+ handle.write(out)
+ elif not return_string:
+ print(out)
+ else:
+ return out
def print_json(self, out_fname):
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [igt-dev] [PATCH i-g-t v4 08/11] scripts/test_list.py: add support to return a string instead of print
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 08/11] scripts/test_list.py: add support to return a string instead of print Mauro Carvalho Chehab
@ 2023-08-31 17:17 ` Kamil Konieczny
0 siblings, 0 replies; 18+ messages in thread
From: Kamil Konieczny @ 2023-08-31 17:17 UTC (permalink / raw)
To: igt-dev
Hi Mauro,
On 2023-08-31 at 16:52:10 +0200, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab@kernel.org>
>
> Sometimes, we don't want to print a testlist, but instead to return
> it for post-processing. One such example is to add a Sphinx extension
> to parse it and place the results on some existing ReST file.
>
> Add support for it.
>
> A side effect is that we don't need to redirect capture anymore to
> to store the output on a file.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> ---
> scripts/test_list.py | 79 ++++++++++++++++++++------------------------
> 1 file changed, 36 insertions(+), 43 deletions(-)
>
> diff --git a/scripts/test_list.py b/scripts/test_list.py
> index e5bf24f9b5ef..8ef3a136688f 100644
> --- a/scripts/test_list.py
> +++ b/scripts/test_list.py
> @@ -596,20 +596,13 @@ class TestList:
> # Output methods
> #
>
> - def print_rest_flat(self, filename = None):
> + def print_rest_flat(self, filename = None, return_string = False):
>
> """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
> -
> - print("=" * len(self.title))
> - print(self.title)
> - print("=" * len(self.title))
> - print()
> + out = "=" * len(self.title) + "\n"
> + out += self.title + "\n"
> + out += "=" * len(self.title) + "\n\n"
>
> for test in sorted(self.doc.keys()):
> fname = self.doc[test]["File"]
> @@ -631,10 +624,9 @@ class TestList:
> if not subtest_array:
> continue
>
> - print(len(name) * '=')
> - print(name)
> - print(len(name) * '=')
> - print()
> + out += len(name) * '=' + "\n"
> + out += name + "\n"
> + out += len(name) * '=' + "\n\n"
>
> for field in sorted(self.doc[test].keys()):
> if field == "subtest":
> @@ -642,29 +634,30 @@ class TestList:
> if field in self.internal_fields:
> continue
>
> - print(f":{field}: {self.doc[test][field]}")
> + out += f":{field}: {self.doc[test][field]}\n"
>
> for subtest in subtest_array:
>
> - print()
> - print(subtest["_summary_"])
> - print(len(subtest["_summary_"]) * '=')
> - print("")
> + out += "\n" + subtest["_summary_"] + "\n"
> + out += len(subtest["_summary_"]) * '=' + "\n\n"
>
> for field in sorted(subtest.keys()):
> if field in self.internal_fields:
> continue
>
> - print(f":{field}:", subtest[field])
> + out += f":{field}:" + subtest[field] + "\n"
>
> - print()
> + out += "\n"
>
> - print()
> - print()
> + out += "\n\n"
>
> - if handler:
> - handler.close()
> - sys.stdout = original_stdout
> + if filename:
> + with open(filename, "w", encoding='utf8') as handle:
> + handle.write(out)
> + elif not return_string:
> + print(out)
> + else:
> + return out
>
> def get_spreadsheet(self):
>
> @@ -708,7 +701,7 @@ class TestList:
> sheet[row].append('')
> return sheet
>
> - def print_nested_rest(self, filename = None):
> + def print_nested_rest(self, filename = None, return_string = False):
>
> """Print tests and subtests ordered by tests"""
>
> @@ -718,10 +711,9 @@ class TestList:
> handler = open(filename, "w", encoding='utf8') # pylint: disable=R1732
> sys.stdout = handler
>
> - print("=" * len(self.title))
> - print(self.title)
> - print("=" * len(self.title))
> - print()
> + out = "=" * len(self.title) + "\n"
> + out += self.title + "\n"
> + out += "=" * len(self.title) + "\n\n"
>
> # Identify the sort order for the fields
> fields_order = []
> @@ -765,14 +757,11 @@ class TestList:
>
> title_str = fields_order[i] + ": " + fields[fields_order[i]]
>
> - print(title_str)
> - print(level_markers[marker] * len(title_str))
> - print()
> + out += title_str + "\n"
> + out += level_markers[marker] * len(title_str) + "\n\n"
> marker += 1
>
> - print()
> - print("``" + subtest + "``")
> - print()
> + out += "\n``" + subtest + "``" + "\n\n"
>
> # print non-hierarchy fields
> for field in fields_order:
> @@ -780,7 +769,7 @@ class TestList:
> continue
>
> if field in fields:
> - print(f":{field}: {fields[field]}")
> + out += f":{field}: {fields[field]}" + "\n"
>
> # Store current values
> for i in range(cur_level, len(fields_order)):
> @@ -792,11 +781,15 @@ class TestList:
> else:
> old_fields[i] = ''
>
> - print()
> + out += "\n"
>
> - if handler:
> - handler.close()
> - sys.stdout = original_stdout
> + if filename:
> + with open(filename, "w", encoding='utf8') as handle:
> + handle.write(out)
> + elif not return_string:
> + print(out)
> + else:
> + return out
>
> def print_json(self, out_fname):
>
> --
> 2.41.0
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [igt-dev] [PATCH i-g-t v4 09/11] scripts/test_list.py: don't rely on file name to parse config
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (7 preceding siblings ...)
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 08/11] scripts/test_list.py: add support to return a string instead of print Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 10/11] scripts/test_list.py: allow passing a config dict directly Mauro Carvalho Chehab
` (4 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Currently, config_fname should not be empty, as the class init
will fail. Make the logic more generic to prepare to optionally pass
the configuration dict directly.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index 8ef3a136688f..962dbbadeeee 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -255,7 +255,6 @@ class TestList:
self.filenames = file_list
self.plan_filenames = []
self.props = {}
- self.config_fname = config_fname
self.igt_build_path = igt_build_path
self.level_count = 0
self.field_list = {}
@@ -276,6 +275,9 @@ class TestList:
with open(config_fname, 'r', encoding='utf8') as handle:
self.config = json.load(handle)
+ config_origin = config_fname
+ cfg_path = os.path.realpath(os.path.dirname(config_fname)) + "/"
+
self.__add_field(None, 0, 0, self.config["fields"])
sublevel_count = [ 0 ] * self.level_count
@@ -317,12 +319,12 @@ class TestList:
files = self.config["files"]
exclude_file_glob = self.config.get("exclude_files", [])
for cfg_file in exclude_file_glob:
- cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
+ cfg_file = cfg_path + cfg_file
for fname in glob.glob(cfg_file):
exclude_files.append(fname)
for cfg_file in files:
- cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
+ cfg_file = cfg_path + cfg_file
for fname in glob.glob(cfg_file):
if fname in exclude_files:
continue
@@ -338,7 +340,7 @@ class TestList:
implemented_class = "Implemented"
files = self.config["planning_files"]
for cfg_file in files:
- cfg_file = os.path.realpath(os.path.dirname(config_fname)) + "/" + cfg_file
+ cfg_file = cfg_path + cfg_file
for fname in glob.glob(cfg_file):
self.plan_filenames.append(fname)
has_planned = True
@@ -366,12 +368,12 @@ class TestList:
continue
self.__add_file_documentation(fname, implemented_class, field_re,
- test_tag, subtest_tag)
+ test_tag, subtest_tag, config_origin)
if include_plan:
for fname in self.plan_filenames:
self.__add_file_documentation(fname, planned_class, field_re,
- test_tag, subtest_tag)
+ test_tag, subtest_tag, config_origin)
#
# ancillary methods
@@ -1011,7 +1013,7 @@ class TestList:
#
def __add_file_documentation(self, fname, implemented_class, field_re,
- test_tag, subtest_tag):
+ test_tag, subtest_tag, config_origin):
"""Adds the contents of test/subtest documentation form a file"""
@@ -1221,7 +1223,7 @@ class TestList:
file_line.rstrip(r"\n")
sys.exit(f"{fname}:{file_ln + 1}: Error: unrecognized line. Need to add field at %s?\n\t==> %s" %
- (self.config_fname, file_line))
+ (config_origin, file_line))
def show_subtests(self, sort_field):
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [igt-dev] [PATCH i-g-t v4 10/11] scripts/test_list.py: allow passing a config dict directly
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (8 preceding siblings ...)
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 09/11] scripts/test_list.py: don't rely on file name to parse config Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 11/11] scripts/igt_doc.py: use field names when create a TestList instance Mauro Carvalho Chehab
` (3 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Make the logic more generic by allowing to pass a config dict
directly.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 32 +++++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index 962dbbadeeee..b99e53dccc79 100644
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -245,8 +245,10 @@ class TestList:
Description: test ioctls
"""
- def __init__(self, config_fname, include_plan = False, file_list = False,
+ def __init__(self, config_fname = None,
+ include_plan = False, file_list = None,
igt_build_path = None,
+ config_dict = None, sources_path = None,
test_tag = "TEST", subtest_tag = "SUBTESTS?",
main_name = "igt", subtest_separator = "@"):
self.doc = {}
@@ -265,18 +267,34 @@ class TestList:
self.internal_fields = [ '_summary_', '_arg_', '_subtest_line_' ]
+ # Exclusive or: either one is needed
+ if bool(config_fname) == bool(config_dict):
+ sys.exit("Error: either config filename or config dict shall be used")
+
if self.main_name:
self.main_name += subtest_separator
- driver_name = re.sub(r'(.*/)?([^\/]+)/.*', r'\2', config_fname).capitalize()
-
implemented_class = None
- with open(config_fname, 'r', encoding='utf8') as handle:
- self.config = json.load(handle)
+ if config_fname:
+ with open(config_fname, 'r', encoding='utf8') as handle:
+ self.config = json.load(handle)
- config_origin = config_fname
- cfg_path = os.path.realpath(os.path.dirname(config_fname)) + "/"
+ config_origin = config_fname
+ cfg_path = os.path.realpath(os.path.dirname(config_fname)) + "/"
+ driver_name = re.sub(r'(.*/)?([^\/]+)/.*', r'\2', config_fname).capitalize()
+
+ else:
+ self.config = config_dict
+ config_origin = "config dict"
+ cfg_path = "./"
+ driver_name = main_name
+
+ if sources_path:
+ cfg_path = os.path.realpath(sources_path) + "/"
+
+ if not self.config:
+ sys.exit("Error: configuration is empty!")
self.__add_field(None, 0, 0, self.config["fields"])
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [igt-dev] [PATCH i-g-t v4 11/11] scripts/igt_doc.py: use field names when create a TestList instance
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (9 preceding siblings ...)
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 10/11] scripts/test_list.py: allow passing a config dict directly Mauro Carvalho Chehab
@ 2023-08-31 14:52 ` Mauro Carvalho Chehab
2023-08-31 19:35 ` [igt-dev] ✗ GitLab.Pipeline: warning for Make test_list.py more generic Patchwork
` (2 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Mauro Carvalho Chehab @ 2023-08-31 14:52 UTC (permalink / raw)
To: igt-dev
From: Mauro Carvalho Chehab <mchehab@kernel.org>
Makes the caller more generic by explicitly passing the field
name when calling TestList. This allows updating the class and
eventually re-ordering fields without the need of changes on
igt_doc.py.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/igt_doc.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/igt_doc.py b/scripts/igt_doc.py
index 38e2bdee4f2a..86e49970ea28 100755
--- a/scripts/igt_doc.py
+++ b/scripts/igt_doc.py
@@ -48,8 +48,10 @@ parser.add_argument('--files', nargs='+',
parse_args = parser.parse_args()
-tests = TestList(parse_args.config, parse_args.include_plan, parse_args.files,
- parse_args.igt_build_path)
+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)
if parse_args.filter_field:
for filter_expr in parse_args.filter_field:
--
2.41.0
^ permalink raw reply related [flat|nested] 18+ messages in thread* [igt-dev] ✗ GitLab.Pipeline: warning for Make test_list.py more generic
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (10 preceding siblings ...)
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 11/11] scripts/igt_doc.py: use field names when create a TestList instance Mauro Carvalho Chehab
@ 2023-08-31 19:35 ` Patchwork
2023-08-31 20:02 ` [igt-dev] ✓ CI.xeBAT: success " Patchwork
2023-08-31 20:12 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
13 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2023-08-31 19:35 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: igt-dev
== Series Details ==
Series: Make test_list.py more generic
URL : https://patchwork.freedesktop.org/series/123112/
State : warning
== Summary ==
Pipeline status: FAILED.
see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/974787 for the overview.
build-containers:build-debian has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/48327375):
time="2023-08-31T19:30:46Z" level=fatal msg="Error determining repository tags: Get https://registry.freedesktop.org/v2/gfx-ci/igt-ci-tags/build-debian/tags/list?last=commit-502a9978d482a8e229fe17db5666b950bf54fccb&n=100: dial tcp 147.75.198.156:443: i/o timeout"
Building!
STEP 1: FROM registry.freedesktop.org/gfx-ci/igt-ci-tags/build-debian-minimal:commit-c85128e56b2fcf21927fcfd9c97f03cc7c224605
Getting image source signatures
Copying blob sha256:2f92e8d0541551f215cc8116b6a6507a714a936f45b19286a6664467db837932
Copying config sha256:08904a47f4efcc161569a9b7f88c458fc6e3e85a2225132246af9cf5cc6c4e5b
Writing manifest to image destination
Storing signatures
STEP 2: RUN apt-get update
error running container: error creating container for [/bin/sh -c apt-get update]: time="2023-08-31T19:31:01Z" level=warning msg="signal: killed"
time="2023-08-31T19:31:01Z" level=error msg="container_linux.go:346: starting container process caused \"process_linux.go:297: applying cgroup configuration for process caused \\\"mountpoint for cgroup not found\\\"\"\n"
container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"mountpoint for cgroup not found\""
: exit status 1
Error: error building at STEP "RUN apt-get update": error while running runtime: exit status 1
section_end:1693510263:step_script
section_start:1693510263:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1693510263:cleanup_file_variables
ERROR: Job failed: exit code 1
build-containers:build-debian-armhf has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/48327376):
"intel-IGTPW_3413"
],
"Created": "2019-11-20T12:54:52.073706506Z",
"DockerVersion": "",
"Labels": {},
"Architecture": "amd64",
"Os": "linux",
"Layers": [
"sha256:45252bb38c9c74dfe76c4b3808269db61d3b2aebe5e26bf7fcd85e48b93e16f9"
]
}
Skipping, already built
Getting image source signatures
time="2023-08-31T19:30:32Z" level=fatal msg="Error trying to reuse blob sha256:45252bb38c9c74dfe76c4b3808269db61d3b2aebe5e26bf7fcd85e48b93e16f9 at destination: Get https://gitlab.freedesktop.org/jwt/auth?account=gitlab-ci-token&scope=repository%3Agfx-ci%2Figt-ci-tags%2Fbuild-debian-armhf%3Apull%2Cpush&service=container_registry: dial tcp 147.75.198.156:443: i/o timeout"
section_end:1693510233:step_script
section_start:1693510233:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1693510235:cleanup_file_variables
ERROR: Job failed: exit code 1
build-containers:build-debian-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/48327378):
time="2023-08-31T19:30:20Z" level=fatal msg="Error determining repository tags: Get https://registry.freedesktop.org/v2/gfx-ci/igt-ci-tags/build-debian-mips/tags/list?last=commit-2823b9154944a986c7b593d009774fb22ad3ff36&n=100: dial tcp 147.75.198.156:443: i/o timeout"
Building!
STEP 1: FROM debian:buster
Getting image source signatures
Copying blob sha256:d6b7393fb4f375905c31c483d81ce2a2905f88aba8cb198874da2b54035bc41d
Copying config sha256:de08540e8ff0e470ff7956df4bed403725a5f45c186e9bf495da5344ff8fbe84
Writing manifest to image destination
Storing signatures
STEP 2: RUN apt-get update
error running container: error creating container for [/bin/sh -c apt-get update]: time="2023-08-31T19:30:25Z" level=warning msg="signal: killed"
time="2023-08-31T19:30:25Z" level=error msg="container_linux.go:346: starting container process caused \"process_linux.go:297: applying cgroup configuration for process caused \\\"mountpoint for cgroup not found\\\"\"\n"
container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"mountpoint for cgroup not found\""
: exit status 1
Error: error building at STEP "RUN apt-get update": error while running runtime: exit status 1
section_end:1693510226:step_script
section_start:1693510226:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1693510227:cleanup_file_variables
ERROR: Job failed: exit code 1
== Logs ==
For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/974787
^ permalink raw reply [flat|nested] 18+ messages in thread* [igt-dev] ✓ CI.xeBAT: success for Make test_list.py more generic
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (11 preceding siblings ...)
2023-08-31 19:35 ` [igt-dev] ✗ GitLab.Pipeline: warning for Make test_list.py more generic Patchwork
@ 2023-08-31 20:02 ` Patchwork
2023-08-31 20:12 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
13 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2023-08-31 20:02 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 2203 bytes --]
== Series Details ==
Series: Make test_list.py more generic
URL : https://patchwork.freedesktop.org/series/123112/
State : success
== Summary ==
CI Bug Log - changes from XEIGT_7460_BAT -> XEIGTPW_9695_BAT
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Participating hosts (4 -> 4)
------------------------------
No changes in participating hosts
Known issues
------------
Here are the changes found in XEIGTPW_9695_BAT that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@kms_flip@basic-flip-vs-wf_vblank@d-edp1:
- bat-adlp-7: [PASS][1] -> [FAIL][2] ([Intel XE#480]) +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7460/bat-adlp-7/igt@kms_flip@basic-flip-vs-wf_vblank@d-edp1.html
[2]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9695/bat-adlp-7/igt@kms_flip@basic-flip-vs-wf_vblank@d-edp1.html
#### Possible fixes ####
* {igt@xe_create@create-execqueues-noleak}:
- bat-atsm-2: [FAIL][3] ([Intel XE#524]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/intel-xe/IGT_7460/bat-atsm-2/igt@xe_create@create-execqueues-noleak.html
[4]: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9695/bat-atsm-2/igt@xe_create@create-execqueues-noleak.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[Intel XE#480]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/480
[Intel XE#524]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/524
Build changes
-------------
* IGT: IGT_7460 -> IGTPW_9695
* Linux: xe-348-72da4b45f58f2a95d45743801a10e1f1e1dcce05 -> xe-350-62acaf965d51695cdc9622608e7a2440db46997c
IGTPW_9695: 9695
IGT_7460: 30b4034ea562952039ba6af58106791d5c39999e @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
xe-348-72da4b45f58f2a95d45743801a10e1f1e1dcce05: 72da4b45f58f2a95d45743801a10e1f1e1dcce05
xe-350-62acaf965d51695cdc9622608e7a2440db46997c: 62acaf965d51695cdc9622608e7a2440db46997c
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9695/index.html
[-- Attachment #2: Type: text/html, Size: 2812 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread* [igt-dev] ✗ Fi.CI.BAT: failure for Make test_list.py more generic
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
` (12 preceding siblings ...)
2023-08-31 20:02 ` [igt-dev] ✓ CI.xeBAT: success " Patchwork
@ 2023-08-31 20:12 ` Patchwork
13 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2023-08-31 20:12 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 9241 bytes --]
== Series Details ==
Series: Make test_list.py more generic
URL : https://patchwork.freedesktop.org/series/123112/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_13583 -> IGTPW_9695
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_9695 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_9695, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/index.html
Participating hosts (38 -> 39)
------------------------------
Additional (2): fi-kbl-soraka bat-rpls-2
Missing (1): fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_9695:
### IGT changes ###
#### Possible regressions ####
* igt@i915_module_load@reload:
- bat-mtlp-6: [PASS][1] -> [ABORT][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13583/bat-mtlp-6/igt@i915_module_load@reload.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-mtlp-6/igt@i915_module_load@reload.html
Known issues
------------
Here are the changes found in IGTPW_9695 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@debugfs_test@basic-hwmon:
- bat-rpls-2: NOTRUN -> [SKIP][3] ([i915#7456])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@debugfs_test@basic-hwmon.html
* igt@fbdev@info:
- bat-rpls-2: NOTRUN -> [SKIP][4] ([i915#1849] / [i915#2582])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@fbdev@info.html
* igt@fbdev@read:
- bat-rpls-2: NOTRUN -> [SKIP][5] ([i915#2582]) +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@fbdev@read.html
* igt@gem_busy@busy@all-engines:
- bat-mtlp-8: [PASS][6] -> [DMESG-FAIL][7] ([i915#9121])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13583/bat-mtlp-8/igt@gem_busy@busy@all-engines.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-mtlp-8/igt@gem_busy@busy@all-engines.html
* igt@gem_huc_copy@huc-copy:
- fi-kbl-soraka: NOTRUN -> [SKIP][8] ([fdo#109271] / [i915#2190])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/fi-kbl-soraka/igt@gem_huc_copy@huc-copy.html
* igt@gem_lmem_swapping@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][9] ([fdo#109271] / [i915#4613]) +3 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/fi-kbl-soraka/igt@gem_lmem_swapping@basic.html
* igt@gem_lmem_swapping@verify-random:
- bat-rpls-2: NOTRUN -> [SKIP][10] ([i915#4613]) +3 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@gem_lmem_swapping@verify-random.html
* igt@gem_tiled_pread_basic:
- bat-rpls-2: NOTRUN -> [SKIP][11] ([i915#3282])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@gem_tiled_pread_basic.html
* igt@i915_pm_backlight@basic-brightness:
- bat-rpls-2: NOTRUN -> [SKIP][12] ([i915#7561])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@i915_pm_backlight@basic-brightness.html
* igt@i915_pm_rps@basic-api:
- bat-rpls-2: NOTRUN -> [SKIP][13] ([i915#6621])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@i915_pm_rps@basic-api.html
* igt@i915_selftest@live@gt_heartbeat:
- fi-apl-guc: [PASS][14] -> [DMESG-FAIL][15] ([i915#5334])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13583/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
* igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][16] ([i915#1886] / [i915#7913])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html
* igt@kms_busy@basic:
- bat-rpls-2: NOTRUN -> [SKIP][17] ([i915#1845]) +16 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@kms_busy@basic.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-kbl-soraka: NOTRUN -> [SKIP][18] ([fdo#109271]) +8 similar issues
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/fi-kbl-soraka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html
* igt@kms_flip@basic-flip-vs-dpms:
- bat-rpls-2: NOTRUN -> [SKIP][19] ([i915#3637]) +3 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@kms_flip@basic-flip-vs-dpms.html
* igt@kms_force_connector_basic@force-load-detect:
- bat-rpls-2: NOTRUN -> [SKIP][20] ([fdo#109285])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@kms_force_connector_basic@force-load-detect.html
* igt@kms_frontbuffer_tracking@basic:
- bat-rpls-2: NOTRUN -> [SKIP][21] ([i915#1849])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@kms_frontbuffer_tracking@basic.html
* igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1:
- bat-rplp-1: [PASS][22] -> [ABORT][23] ([i915#8442] / [i915#8668])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13583/bat-rplp-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1.html
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rplp-1/igt@kms_pipe_crc_basic@read-crc-frame-sequence@pipe-d-edp-1.html
* igt@kms_psr@sprite_plane_onoff:
- bat-rpls-2: NOTRUN -> [SKIP][24] ([i915#1072]) +3 similar issues
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@kms_psr@sprite_plane_onoff.html
* igt@kms_setmode@basic-clone-single-crtc:
- bat-rpls-2: NOTRUN -> [SKIP][25] ([i915#3555])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@kms_setmode@basic-clone-single-crtc.html
* igt@prime_vgem@basic-fence-flip:
- bat-rpls-2: NOTRUN -> [SKIP][26] ([fdo#109295] / [i915#1845] / [i915#3708])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@prime_vgem@basic-fence-flip.html
* igt@prime_vgem@basic-fence-read:
- bat-rpls-2: NOTRUN -> [SKIP][27] ([fdo#109295] / [i915#3708]) +2 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-rpls-2/igt@prime_vgem@basic-fence-read.html
#### Possible fixes ####
* igt@kms_chamelium_edid@hdmi-edid-read:
- {bat-dg2-13}: [DMESG-WARN][28] ([i915#7952]) -> [PASS][29]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13583/bat-dg2-13/igt@kms_chamelium_edid@hdmi-edid-read.html
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/bat-dg2-13/igt@kms_chamelium_edid@hdmi-edid-read.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7952]: https://gitlab.freedesktop.org/drm/intel/issues/7952
[i915#8442]: https://gitlab.freedesktop.org/drm/intel/issues/8442
[i915#8668]: https://gitlab.freedesktop.org/drm/intel/issues/8668
[i915#9121]: https://gitlab.freedesktop.org/drm/intel/issues/9121
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_7460 -> IGTPW_9695
CI-20190529: 20190529
CI_DRM_13583: f299d7585a085ee36999da219c292e265da35886 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_9695: 9695
IGT_7460: 30b4034ea562952039ba6af58106791d5c39999e @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9695/index.html
[-- Attachment #2: Type: text/html, Size: 10983 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread