From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A37AF41E90; Tue, 14 Mar 2023 10:04:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9DAEC410DF; Tue, 14 Mar 2023 10:04:13 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 30F8440A7E for ; Tue, 14 Mar 2023 10:04:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678784652; x=1710320652; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uQG51mftIjdiyug7X/j2QPTWia1092CAdr2DRPl1NEY=; b=ibmarWe0D6jWE/2zJVO3NACSiVkMrmqSB8JG2wtyK9q/k7BVnQAA7Iy1 W1v8krg6Eg5WcS8tRN01PRQAcRWhxfge02Kv52Os+QnQMeDLm2ki9hiKk x7F2QeBO+sYqDYn7zHbUbNi7UPmkYpNP48Q4yF+1V/0IHKmOzTZekwDPs m0gL3KppIZABgWdXBGP/XjngiL4+OZVjK1ndj6MFe6eU6+l/mxAzrwrPr DrSVsnPtglbEJ0xbeoqX3UnY6UlTW6B9ERb8UKucDlIZUa0Ns3tf1Y9A6 ah5HtgAct4MMUiwmj0Y/NcbaPU8+lQimT3+6Xq4LEiWu9UGagn38b+yvC g==; X-IronPort-AV: E=McAfee;i="6500,9779,10648"; a="334851371" X-IronPort-AV: E=Sophos;i="5.98,259,1673942400"; d="scan'208";a="334851371" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2023 02:04:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10648"; a="628974643" X-IronPort-AV: E=Sophos;i="5.98,259,1673942400"; d="scan'208";a="628974643" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by orsmga003.jf.intel.com with ESMTP; 14 Mar 2023 02:04:09 -0700 From: Ke Xu 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 Message-Id: <20230314090107.669640-3-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230314090107.669640-1-ke1.xu@intel.com> References: <20230314090107.669640-1-ke1.xu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org 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 --- 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