From: "Dong, JunX" <junx.dong@intel.com>
To: "Juraj Linkeš" <juraj.linkes@pantheon.tech>,
"dts@dpdk.org" <dts@dpdk.org>
Cc: "Tu, Lijuan" <lijuan.tu@intel.com>, "Sun, QingX" <qingx.sun@intel.com>
Subject: RE: [V1] framework/*: Replace framework texttable with third party library
Date: Wed, 30 Mar 2022 09:11:50 +0000 [thread overview]
Message-ID: <DM5PR11MB1404AF7381FC72671B08A772EA1F9@DM5PR11MB1404.namprd11.prod.outlook.com> (raw)
> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Wednesday, March 30, 2022 4:03 PM
> To: Dong, JunX <junx.dong@intel.com>; dts@dpdk.org
> Cc: Tu, Lijuan <lijuan.tu@intel.com>; Sun, QingX <qingx.sun@intel.com>
> Subject: RE: [V1] framework/*: Replace framework texttable with third party
> libary
> > -----Original Message-----
> > From: Jun Dong <junx.dong@intel.com>
> > Sent: Wednesday, March 30, 2022 9:14 AM
> > To: dts@dpdk.org
> > Cc: lijuan.tu@intel.com; qingx.sun@intel.com; junx.dong@intel.com
> > Subject: [V1] framework/*: Replace framework texttable with third
> > party libary
> >
> > Signed-off-by: Jun Dong <junx.dong@intel.com>
> > ---
> > framework/dts.py | 1 -
> > framework/test_result.py | 5 +-
> > framework/texttable.py | 645 ---------------------------------------
> > requirements.txt | 3 +-
> > tests/perf_test_base.py | 5 +-
> > 5 files changed, 8 insertions(+), 651 deletions(-) delete mode
> > 100644 framework/texttable.py
> >
>
> > diff --git a/framework/test_result.py b/framework/test_result.py index
> > 0231e769..abf8edb9 100644
> > --- a/framework/test_result.py
> > +++ b/framework/test_result.py
> > @@ -32,7 +32,6 @@
> > """
> > Generic result container and reporters """
> > -import framework.texttable as texttable # text format
> >
> >
> > class Result(object):
> > @@ -445,9 +444,11 @@ class ResultTable(object):
> > rt.add_row(row)
> > rt.table_print()
> > """
> > + from texttable import Texttable
> > +
> > self.results_table_rows = []
> > self.results_table_rows.append([])
> > - self.table = texttable.Texttable(max_width=150)
> > + self.table = Texttable(max_width=150)
> > self.results_table_header = header
> > self.logger = None
> > self.rst = None
>
> Is there a reason for moving the import statement? I'd prefer to have it at
> the beginning of the file.
Hi, Juraj Linkeš, thanks for your comments.
Sometimes, the trex will be used When execute performance suite,
And trex also used texttable that comes from itself.
But, the third party library texttable wasn't full compatible with the trex's version,
If import texttable in global in DTS framework will effect trex which not import again,
So, import texttable locally in the DTS framework.
> > diff --git a/tests/perf_test_base.py b/tests/perf_test_base.py index
> > 0666f3bf..82ae74f4 100644
> > --- a/tests/perf_test_base.py
> > +++ b/tests/perf_test_base.py
> > @@ -44,7 +44,6 @@ from pprint import pformat
> >
> > import numpy as np
> >
> > -import framework.texttable as texttable import framework.utils as
> > utils from framework.config import SuiteConf from
> > framework.exception import VerifyFailure @@ -1039,11 +1038,13 @@ class
> PerfTestBase(object):
> > return mode_name
> >
> > def __display_suite_result(self, data):
> > + from texttable import Texttable
> > +
> > values = data.get("values")
> > title = data.get("title")
> > max_length = sum([len(item) + 5 for item in title])
> > self.result_table_create(title)
> > - self._result_table.table = texttable.Texttable(max_width=max_length)
> > + self._result_table.table = Texttable(max_width=max_length)
> > for value in values:
> > self.result_table_add(value)
> > self.result_table_print()
> > --
> > 2.33.1.windows.1
> >
>
> Same here.
next reply other threads:[~2022-03-30 9:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-30 9:11 Dong, JunX [this message]
2022-03-30 11:32 ` Juraj Linkeš
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=DM5PR11MB1404AF7381FC72671B08A772EA1F9@DM5PR11MB1404.namprd11.prod.outlook.com \
--to=junx.dong@intel.com \
--cc=dts@dpdk.org \
--cc=juraj.linkes@pantheon.tech \
--cc=lijuan.tu@intel.com \
--cc=qingx.sun@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).