From patchwork Wed Mar 31 10:16:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tu, Lijuan" X-Patchwork-Id: 90152 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 43FCFA034F; Wed, 31 Mar 2021 04:18:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1909F140DE4; Wed, 31 Mar 2021 04:18:02 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 4C95340141 for ; Wed, 31 Mar 2021 04:18:00 +0200 (CEST) IronPort-SDR: ajkFxlTy9fqojGtHQu17sDxRh2KklCro3/vV+69XBUZEzpb7IiUKRZjL3d+LxgSBXu8H/eINHo kch+7Ck3NkBg== X-IronPort-AV: E=McAfee;i="6000,8403,9939"; a="179027926" X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="179027926" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 19:17:56 -0700 IronPort-SDR: gr2gm2rRQasG5QER5AEDg41UYsj6zKoyBPWQ56pMepk30jbuzbENWtoAg3XcRxcXJ0BnR092od xfDUsE3GIu6g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="445432376" Received: from dpdk-icelake-perf.sh.intel.com ([10.67.118.199]) by fmsmga002.fm.intel.com with ESMTP; 30 Mar 2021 19:17:55 -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 10:16:54 +0000 Message-Id: <20210331101659.506185-2-lijuan.tu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210331101659.506185-1-lijuan.tu@intel.com> References: <20210331101659.506185-1-lijuan.tu@intel.com> MIME-Version: 1.0 Subject: [dts] [v3 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 separators and indents, 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):