* RE: [V1] framework/*: Replace framework texttable with third party library
@ 2022-03-30 9:11 Dong, JunX
2022-03-30 11:32 ` Juraj Linkeš
0 siblings, 1 reply; 2+ messages in thread
From: Dong, JunX @ 2022-03-30 9:11 UTC (permalink / raw)
To: Juraj Linkeš, dts; +Cc: Tu, Lijuan, Sun, QingX
> -----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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [V1] framework/*: Replace framework texttable with third party library
2022-03-30 9:11 [V1] framework/*: Replace framework texttable with third party library Dong, JunX
@ 2022-03-30 11:32 ` Juraj Linkeš
0 siblings, 0 replies; 2+ messages in thread
From: Juraj Linkeš @ 2022-03-30 11:32 UTC (permalink / raw)
To: Dong, JunX, dts; +Cc: Tu, Lijuan, Sun, QingX
> > > 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.
>
Ah, okay. I guess that's a reasonable workaround. I'm fine with this then.
Acked-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-30 11:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 9:11 [V1] framework/*: Replace framework texttable with third party library Dong, JunX
2022-03-30 11:32 ` Juraj Linkeš
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).