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 1557BA0547; Wed, 31 Mar 2021 03:35:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F41B140D8C; Wed, 31 Mar 2021 03:35:33 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id E393440141 for ; Wed, 31 Mar 2021 03:35:31 +0200 (CEST) IronPort-SDR: xWMoBTttYYxUSnAsfvb5BaPeSarpR/B7MF66+urZ852/3IC+GqUeC7LqN06woUS109dqum5x6N jAYP+sFhnABw== X-IronPort-AV: E=McAfee;i="6000,8403,9939"; a="277070324" X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="277070324" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 18:35:31 -0700 IronPort-SDR: 9JEkCtP4V2b+OYw3YCQybtcXdg2kSOIhYqGn1rH2tJNqXlTa/ZtllmIQzbwwXWDvcaqtJsRrRf ie7U+/nzRBng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="445418557" Received: from dpdk-icelake-perf.sh.intel.com ([10.67.118.199]) by fmsmga002.fm.intel.com with ESMTP; 30 Mar 2021 18:35:29 -0700 From: Lijuan Tu To: dliu@iol.unh.edu, ohilyard@iol.unh.edu, alialnu@nvidia.com Cc: dts@dpdk.org, Lijuan Tu Date: Wed, 31 Mar 2021 09:34:05 +0000 Message-Id: <20210331093410.505773-2-lijuan.tu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210331093410.505773-1-lijuan.tu@intel.com> References: <20210331093410.505773-1-lijuan.tu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dts] [v2 1/6] tests/nic_single_core_perf: beauty JSON string 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 Sender: "dts" with seperators and intent, the JSON are more human friendly. before: {"test_perf_nic_single_core": [{ "parameters": [{"name": "Txd/Rxd", ...}, ... } after: { "test_perf_nic_single_core": [ { "parameters": [ { "name": "Txd/Rxd", ... }, ... } Signed-off-by: Lijuan Tu --- tests/TestSuite_nic_single_core_perf.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/TestSuite_nic_single_core_perf.py b/tests/TestSuite_nic_single_core_perf.py index 8266506b..edb4465d 100644 --- a/tests/TestSuite_nic_single_core_perf.py +++ b/tests/TestSuite_nic_single_core_perf.py @@ -368,10 +368,11 @@ class TestNicSingleCorePerf(TestCase): row_dict0['parameters'].append(row_dict4) json_obj[case_name].append(row_dict0) status_result.append(row_dict0['status']) - with open(os.path.join(rst.path2Result, - '{0:s}_single_core_perf.json'.format( - self.nic)), 'w') as fp: - json.dump(json_obj, fp) + + json_file = os.path.join(rst.path2Result, '{0:s}_single_core_perf.json'.format(self.nic)) + with open(json_file, 'w') as fp: + json.dump(json_obj, fp, indent=4, separators=(',', ': '), sort_keys=True) + self.verify("FAIL" not in status_result, "Excessive gap between test results and expectations") def set_fields(self): -- 2.25.1