test suite reviews and discussions
 help / color / mirror / Atom feed
From: Lijuan Tu <lijuan.tu@intel.com>
To: dliu@iol.unh.edu, ohilyard@iol.unh.edu, alialnu@nvidia.com
Cc: dts@dpdk.org, Lijuan Tu <lijuan.tu@intel.com>
Subject: [dts] [v3 1/6] tests/nic_single_core_perf: beauty JSON string
Date: Wed, 31 Mar 2021 10:16:54 +0000
Message-ID: <20210331101659.506185-2-lijuan.tu@intel.com> (raw)
In-Reply-To: <20210331101659.506185-1-lijuan.tu@intel.com>

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 <lijuan.tu@intel.com>
---
 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


  reply	other threads:[~2021-03-31  2:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31 10:16 [dts] [v3 0/6] revise tests/nic_signle_core_perf Lijuan Tu
2021-03-31 10:16 ` Lijuan Tu [this message]
2021-03-31 10:16 ` [dts] [v3 2/6] tests/nic_single_core_perf: get better throughput stats Lijuan Tu
2021-03-31 10:16 ` [dts] [v3 3/6] tests/nic_single_core_perf: revise rst table Lijuan Tu
2021-03-31 10:16 ` [dts] [v3 4/6] tests/nic_single_core_perf: revise delta to ratio Lijuan Tu
2021-03-31 10:16 ` [dts] [v3 5/6] tests/nic_single_core_perf: add expected mpps into JSON Lijuan Tu
2021-03-31 10:16 ` [dts] [v3 6/6] tests/nic_single_core_perf: revise rx desc size Lijuan Tu
2021-06-17 13:39 ` [dts] [v3 0/6] revise tests/nic_signle_core_perf Ali Alnubani
2021-06-29  6:33   ` Tu, Lijuan

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=20210331101659.506185-2-lijuan.tu@intel.com \
    --to=lijuan.tu@intel.com \
    --cc=alialnu@nvidia.com \
    --cc=dliu@iol.unh.edu \
    --cc=dts@dpdk.org \
    --cc=ohilyard@iol.unh.edu \
    /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

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ https://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git