test suite reviews and discussions
 help / color / mirror / Atom feed
From: Ke Xu <ke1.xu@intel.com>
To: dts@dpdk.org
Cc: lijuan.tu@intel.com, ke1.xu@intel.com
Subject: [DTS][PATCH V1 2/2] framework/dts: fix result output by merging cases when parsing execution requirements.
Date: Tue, 14 Mar 2023 17:01:07 +0800	[thread overview]
Message-ID: <20230314090107.669640-3-ke1.xu@intel.com> (raw)
In-Reply-To: <20230314090107.669640-1-ke1.xu@intel.com>

In execution config, multi-run suites and cases are grammarly allowed.
 When we call for a suite multiple times, the new result will overwrite
 the old result totally.

This fix merges duplicated lines for suites when parsing the execution
 configuration, preventing the potential multiple run of suites and
 cases.

Signed-off-by: Ke Xu <ke1.xu@intel.com>
---
 framework/dts.py | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/framework/dts.py b/framework/dts.py
index a8e670b5..b55aed90 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -149,9 +149,32 @@ def dts_parse_config(config, section):
     settings.save_global_setting(settings.DPDK_RXMODE_SETTING, rx_mode)
     settings.save_global_setting(settings.DPDK_DCFMODE_SETTING, dcf_mode)
 
+    suite_list_dedup = {}
+    ## suite_list_dedup[suite_name] := { True | Set | ... }
+    ## True := All Cases to Run
+    ## Set := Listed Cases to Run
     for suite in test_suites:
         if suite == "":
-            test_suites.remove(suite)
+            pass
+        elif ":" in suite:
+            suite_name = suite[: suite.find(":")]
+            case_list_str = suite[suite.find(":") + 1 :]
+            case_list = case_list_str.split("\\")
+            if not suite_name in suite_list_dedup:
+                suite_list_dedup[suite_name] = set()
+            if isinstance(suite_list_dedup[suite_name], set):
+                suite_list_dedup[suite_name].update(case_list)
+            elif suite_list_dedup[suite_name] == True:
+                pass
+        else:
+            suite_list_dedup[suite] = True
+    
+    test_suites = []
+    for suite in suite_list_dedup:
+        if suite_list_dedup[suite] == True:
+            test_suites.append(suite)
+        elif isinstance(suite_list_dedup[suite], set) and suite_list_dedup[suite]:
+            test_suites.append(suite + ":" + "\\".join(suite_list_dedup[suite]))
 
     return duts, targets, test_suites
 
-- 
2.25.1


      parent reply	other threads:[~2023-03-14  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14  9:01 [DTS][PATCH V1 0/2] fix result output overwriting when using multiple lines in execution configuration for one suite Ke Xu
2023-03-14  9:01 ` [DTS][PATCH V1 1/2] framework/test_result: fix unsafe __set_test_case Ke Xu
2023-03-14  9:01 ` Ke Xu [this message]

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=20230314090107.669640-3-ke1.xu@intel.com \
    --to=ke1.xu@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).