Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 1/6] scripts/test_list.py: expand testlist fields
Date: Mon,  8 May 2023 14:41:11 +0200	[thread overview]
Message-ID: <20230508124116.1099603-2-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230508124116.1099603-1-mauro.chehab@linux.intel.com>

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 9a909e3640f6..e68a4cb3df71 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -762,7 +762,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"""
 
@@ -789,10 +789,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"])
 
@@ -1132,7 +1139,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, ",")
 
         if not os.path.exists(directory):
             os.makedirs(directory)
-- 
2.40.1

  reply	other threads:[~2023-05-08 12:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-08 12:41 [igt-dev] [PATCH i-g-t v2 0/6] Better document i915 tests Mauro Carvalho Chehab
2023-05-08 12:41 ` Mauro Carvalho Chehab [this message]
2023-05-08 12:41 ` [igt-dev] [PATCH i-g-t v2 2/6] scripts/test_list.py: add support to exclude files Mauro Carvalho Chehab
2023-05-08 12:41 ` [igt-dev] [PATCH i-g-t v2 3/6] scripts/test_list.py: fix some hints pointed by Ruff Mauro Carvalho Chehab
2023-05-08 12:41 ` [igt-dev] [PATCH i-g-t v2 4/6] testplan/meson.build: add i915 support for a testplan document Mauro Carvalho Chehab
2023-05-08 12:41 ` [igt-dev] [PATCH i-g-t v2 5/6] tests/i915: Improve test documentation Mauro Carvalho Chehab
2023-05-08 12:41 ` [igt-dev] [PATCH i-g-t v2 6/6] tests/i915: Enhance " Mauro Carvalho Chehab
2023-05-08 12:51 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Better document i915 tests (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230508124116.1099603-2-mauro.chehab@linux.intel.com \
    --to=mauro.chehab@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox