aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/generator_tables.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2020-02-19 06:53:42 +0100
committerTibor Frank <tifrank@cisco.com>2020-02-19 08:04:54 +0100
commita4e15f5d5ab4bf94fd40deca12bf9a1787535ab3 (patch)
tree3dea029fc3ca78dfd27e7773ee325d49b10aa05f /resources/tools/presentation/generator_tables.py
parentb51708f0ad28301b87bd66d31713d436f4b9cce2 (diff)
Report: Sort tests in tables
Change-Id: I862a35270a72d66d7cc3c0eaf5fb2bff20dcac7d Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/generator_tables.py')
-rw-r--r--resources/tools/presentation/generator_tables.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py
index cb9df963cc..0d52ce1616 100644
--- a/resources/tools/presentation/generator_tables.py
+++ b/resources/tools/presentation/generator_tables.py
@@ -96,7 +96,14 @@ def table_oper_data_html(table, input_data):
if data.empty:
return
data = input_data.merge_data(data)
- data.sort_index(inplace=True)
+
+ sort_tests = table.get(u"sort", None)
+ if sort_tests and sort_tests in (u"ascending", u"descending"):
+ args = dict(
+ inplace=True,
+ ascending=True if sort_tests == u"ascending" else False
+ )
+ data.sort_index(**args)
suites = input_data.filter_data(
table,
@@ -284,12 +291,15 @@ def table_merged_details(table, input_data):
)
data = input_data.filter_data(table, continue_on_error=True)
data = input_data.merge_data(data)
- data.sort_index(inplace=True)
- logging.info(
- f" Creating the data set for the {table.get(u'type', u'')} "
- f"{table.get(u'title', u'')}."
- )
+ sort_tests = table.get(u"sort", None)
+ if sort_tests and sort_tests in (u"ascending", u"descending"):
+ args = dict(
+ inplace=True,
+ ascending=True if sort_tests == u"ascending" else False
+ )
+ data.sort_index(**args)
+
suites = input_data.filter_data(
table, continue_on_error=True, data_set=u"suites")
suites = input_data.merge_data(suites)