Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] scripts/test_list.py: expand testlist fields
@ 2023-05-05  6:11 Mauro Carvalho Chehab
  2023-05-05  7:11 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2023-05-05 13:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2023-05-05  6:11 UTC (permalink / raw)
  To: igt-dev

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

We're about to add support for i915 testlists. On those,
it is possible to have functionalities mapped to different
buckets, as the same test could be used to test multiple
parts of the driver/hardware.

So, for instance, the subtest igt@prime_vgem@basic-fence-mmap
actually tests two features:
	- gtt
	- prime

A description of such test will then be mapped as:

	* SUBTEST: basic-fence-mmap
	* Description: Examine GTT access path fencing.
	* Feature: gtt, prime

In order to be able to generate per-feature testlists, we
need to expand the Feature field, using the separator field
(currently a comma) to expand the test lists.

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

diff --git a/scripts/test_list.py b/scripts/test_list.py
index a0db07125bc4..c9dbf144da1e 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -772,7 +772,7 @@ class TestList:
     # Subtest list methods
     #
 
-    def get_subtests(self, sort_field = None):
+    def get_subtests(self, sort_field = None, expand = None):
 
         """Return an array with all subtests"""
 
@@ -799,10 +799,17 @@ class TestList:
 
                 if sort_field:
                     if sort_field in subtest:
-                        if subtest[sort_field] not in subtests:
-                            subtests[subtest[sort_field]] = []
-
-                        subtests[subtest[sort_field]].append(subtest["Summary"])
+                        if expand:
+                            test_list = subtest[sort_field].split(expand)
+                            for test_elem in test_list:
+                                test_elem = test_elem.strip()
+                                if test_elem not in subtests:
+                                    subtests[test_elem] = []
+                                subtests[test_elem].append(subtest["Summary"])
+                        else:
+                            if subtest[sort_field] not in subtests:
+                                subtests[subtest[sort_field]] = []
+                            subtests[subtest[sort_field]].append(subtest["Summary"])
                     else:
                         subtests[""].append(subtest["Summary"])
 
@@ -1142,7 +1149,8 @@ class TestList:
         test_prefix = os.path.commonprefix(self.get_subtests()[""])
         test_prefix = re.sub(r'^igt@', '', test_prefix)
 
-        test_subtests = self.get_subtests(sort_field)
+        # NOTE: currently, it uses a comma for multi-value delimitter
+        test_subtests = self.get_subtests(sort_field, ",")
 
         for test in test_subtests.keys():  # pylint: disable=C0201,C0206
             if not test_subtests[test]:
-- 
2.40.1

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

end of thread, other threads:[~2023-05-05 13:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-05  6:11 [igt-dev] [PATCH i-g-t] scripts/test_list.py: expand testlist fields Mauro Carvalho Chehab
2023-05-05  7:11 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-05-05 13:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox