Skip to content

Commit 9370543

Browse files
authored
Merge pull request #3307 from vkarak/enhancement/table-format
[enhancement] Update `--table-format` arguments
2 parents 37c3e45 + 0b17a11 commit 9370543

File tree

7 files changed

+73
-49
lines changed

7 files changed

+73
-49
lines changed

docs/manpage.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,19 +1163,15 @@ Miscellaneous options
11631163

11641164
This option can also be set using the :envvar:`RFM_SYSTEM` environment variable.
11651165

1166-
.. option:: --table-format=csv|plain|outline|grid
1166+
.. option:: --table-format=csv|plain|pretty
11671167

11681168
Set the formatting of tabular output printed by the options :option:`--performance-compare`, :option:`--performance-report` and the options controlling the stored sessions.
11691169

11701170
The acceptable values are the following:
11711171

11721172
- ``csv``: Generate CSV output
1173-
- ``grid``: Generate a table with grid lines
1174-
- ``outline``: (default) Generate a table with lines outlining the table and the header
1175-
- ``plain``: Generate a plain table without any lines
1176-
1177-
Note that the default ``outline`` format will not render correctly multi-line cells.
1178-
In this cases, prefer the ``grid`` or ``plain`` formats.
1173+
- ``plain``: Generate a plain table without any vertical lines allowing for easy ``grep``-ing
1174+
- ``pretty``: (default) Generate a pretty table
11791175

11801176
.. versionadded:: 4.7
11811177

docs/tutorial.rst

Lines changed: 60 additions & 33 deletions
Large diffs are not rendered by default.

reframe/frontend/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def main():
655655
envvar='RFM_SYSTEM'
656656
)
657657
misc_options.add_argument(
658-
'--table-format', choices=['csv', 'plain', 'outline', 'grid'],
658+
'--table-format', choices=['csv', 'pretty', 'plain'],
659659
help='Table formatting',
660660
envvar='RFM_TABLE_FORMAT', configvar='general/table_format'
661661
)

reframe/frontend/printer.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,8 @@ def table(self, data, **kwargs):
276276

277277
# Map our options to tabulate
278278
if table_format == 'plain':
279-
tablefmt = 'plain'
280-
elif table_format == 'outline':
281-
tablefmt = 'mixed_outline'
282-
elif table_format == 'grid':
279+
tablefmt = 'simple'
280+
elif table_format == 'pretty':
283281
tablefmt = 'mixed_grid'
284282
else:
285283
raise ValueError(f'invalid table format: {table_format}')

reframe/frontend/reporting/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,12 @@ def _group_testcases(testcases, groups, columns):
606606

607607
@time_function
608608
def _aggregate_perf(grouped_testcases, aggr_fn, cols):
609-
if runtime().get_option('general/0/table_format') == 'csv':
610-
# Use a csv friendly delimiter
609+
# Update delimiter for joining unique values based on the table format
610+
table_foramt = runtime().get_option('general/0/table_format')
611+
if table_foramt == 'csv':
611612
delim = '|'
613+
elif table_foramt == 'plain':
614+
delim = ','
612615
else:
613616
delim = '\n'
614617

reframe/schemas/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@
599599
"general/report_junit": null,
600600
"general/resolve_module_conflicts": true,
601601
"general/save_log_files": false,
602-
"general/table_format": "outline",
602+
"general/table_format": "pretty",
603603
"general/target_systems": ["*"],
604604
"general/timestamp_dirs": "%Y%m%dT%H%M%S%z",
605605
"general/trap_job_errors": false,

unittests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ def test_testlib_inherit_fixture_in_different_files(run_reframe):
12571257
assert 'FAILED' not in stdout
12581258

12591259

1260-
@pytest.fixture(params=['csv', 'plain', 'grid', 'outline'])
1260+
@pytest.fixture(params=['csv', 'plain', 'pretty'])
12611261
def table_format(request):
12621262
return request.param
12631263

0 commit comments

Comments
 (0)