Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,17 @@ General Configuration
.. versionadded:: 3.9.0


.. js:attribute:: .general[].compress_report

:required: No
:default: ``false``

Compress the generated run report file.
See the documentation of the :option:`--compress-report` option for more information.

.. versionadded:: 3.12.0


.. js:attribute:: .general[].git_timeout

:required: No
Expand Down
24 changes: 24 additions & 0 deletions docs/manpage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,16 @@ If more than one action options are specified, the precedence order is the follo
Options controlling ReFrame output
----------------------------------

.. option:: --compress-report

Compress the generated run report (see :option:`--report-file`).
The generated report is a JSON file formatted in a human readable form.
If this option is enabled, the generated JSON file will be a single stream of text without additional spaces or new lines.

This option can also be set using the :envvar:`RFM_COMPRESS_REPORT` environment variable or the :js:attr:`compress_report` general configuration parameter.

.. versionadded:: 3.12.0

.. option:: --dont-restage

Do not restage a test if its stage directory exists.
Expand Down Expand Up @@ -1110,6 +1120,20 @@ Here is an alphabetical list of the environment variables recognized by ReFrame:
.. versionadded:: 3.9.0


.. envvar:: RFM_COMPRESS_REPORT

Compress the generated run report file.

.. table::
:align: left

================================== ==================
Associated command line option :option:`--compress-report`
Associated configuration parameter :js:attr:`compress_report` general configuration parameter
================================== ==================

.. versionadded:: 3.12.0

.. envvar:: RFM_CONFIG_FILE

Set the configuration file for ReFrame.
Expand Down
12 changes: 10 additions & 2 deletions reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ def main():
misc_options = argparser.add_argument_group('Miscellaneous options')

# Output directory options
output_options.add_argument(
'--compress-report', action='store_true',
help='Compress the run report file',
envvar='RFM_COMPRESS_REPORT', configvar='general/compress_report'
)
output_options.add_argument(
'--dont-restage', action='store_false', dest='clean_stagedir',
help='Reuse the test stage directory',
Expand Down Expand Up @@ -1318,8 +1323,11 @@ def module_unuse(*paths):
report_file = runreport.next_report_filename(report_file)
try:
with open(report_file, 'w') as fp:
jsonext.dump(json_report, fp, indent=2)
fp.write('\n')
if rt.get_option('general/0/compress_report'):
jsonext.dump(json_report, fp)
else:
jsonext.dump(json_report, fp, indent=2)
fp.write('\n')

printer.info(f'Run report saved in {report_file!r}')
except OSError as e:
Expand Down
2 changes: 1 addition & 1 deletion reframe/frontend/runreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The schema data version
# Major version bumps are expected to break the validation of previous schemas

DATA_VERSION = '2.1'
DATA_VERSION = '2.2'
_SCHEMA = os.path.join(rfm.INSTALL_PREFIX, 'reframe/schemas/runreport.json')


Expand Down
13 changes: 13 additions & 0 deletions reframe/frontend/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,19 @@ def json(self, force=False):
'value': val
})

# Add any loggable variables and parameters
entry['check_vars'] = {}
test_cls = type(check)
for name, var in test_cls.var_space.items():
if var.is_loggable():
entry['check_vars'][name] = getattr(check, name)

entry['check_params'] = {}
test_cls = type(check)
for name, param in test_cls.param_space.items():
if param.is_loggable():
entry['check_params'][name] = getattr(check, name)

testcases.append(entry)

self._run_data.append({
Expand Down
2 changes: 2 additions & 0 deletions reframe/schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@
"clean_stagedir": {"type": "boolean"},
"colorize": {"type": "boolean"},
"compact_test_names": {"type": "boolean"},
"compress_report": {"type": "boolean"},
"git_timeout": {"type": "number"},
"ignore_check_conflicts": {"type": "boolean"},
"keep_stage_files": {"type": "boolean"},
Expand Down Expand Up @@ -519,6 +520,7 @@
"general/clean_stagedir": true,
"general/colorize": true,
"general/compact_test_names": false,
"general/compress_report": false,
"general/git_timeout": 5,
"general/ignore_check_conflicts": false,
"general/keep_stage_files": false,
Expand Down
2 changes: 2 additions & 0 deletions reframe/schemas/runreport.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"properties": {
"build_stderr": {"type": ["string", "null"]},
"build_stdout": {"type": ["string", "null"]},
"check_params": {"type": "object"},
"check_vars": {"type": "object"},
"dependencies_actual": {
"type": "array",
"items": {
Expand Down