Skip to content

Commit ca5f8da

Browse files
author
Vasileios Karakasis
authored
Merge branch 'master' into feat/time-profiler
2 parents a87bd19 + 8d758ce commit ca5f8da

File tree

10 files changed

+78
-6
lines changed

10 files changed

+78
-6
lines changed

docs/config_reference.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,11 +1295,10 @@ The options of an execution mode will be passed to ReFrame as if they were speci
12951295
:required: No
12961296
:default: ``["*"]``
12971297

1298-
A list of systems or system/partitions combinations that this execution mode is valid for.
1298+
A list of systems *only* that this execution mode is valid for.
12991299
For a detailed description of this property, you may refer `here <#.environments[].target_systems>`__.
13001300

13011301

1302-
13031302
General Configuration
13041303
---------------------
13051304

@@ -1356,6 +1355,17 @@ General Configuration
13561355
.. versionadded:: 3.9.0
13571356

13581357

1358+
.. js:attribute:: .general[].compress_report
1359+
1360+
:required: No
1361+
:default: ``false``
1362+
1363+
Compress the generated run report file.
1364+
See the documentation of the :option:`--compress-report` option for more information.
1365+
1366+
.. versionadded:: 3.12.0
1367+
1368+
13591369
.. js:attribute:: .general[].git_timeout
13601370

13611371
:required: No

docs/manpage.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,16 @@ If more than one action options are specified, the precedence order is the follo
263263
Options controlling ReFrame output
264264
----------------------------------
265265

266+
.. option:: --compress-report
267+
268+
Compress the generated run report (see :option:`--report-file`).
269+
The generated report is a JSON file formatted in a human readable form.
270+
If this option is enabled, the generated JSON file will be a single stream of text without additional spaces or new lines.
271+
272+
This option can also be set using the :envvar:`RFM_COMPRESS_REPORT` environment variable or the :js:attr:`compress_report` general configuration parameter.
273+
274+
.. versionadded:: 3.12.0
275+
266276
.. option:: --dont-restage
267277

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

11121122

1123+
.. envvar:: RFM_COMPRESS_REPORT
1124+
1125+
Compress the generated run report file.
1126+
1127+
.. table::
1128+
:align: left
1129+
1130+
================================== ==================
1131+
Associated command line option :option:`--compress-report`
1132+
Associated configuration parameter :js:attr:`compress_report` general configuration parameter
1133+
================================== ==================
1134+
1135+
.. versionadded:: 3.12.0
1136+
11131137
.. envvar:: RFM_CONFIG_FILE
11141138

11151139
Set the configuration file for ReFrame.

reframe/frontend/cli.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ def main():
213213
misc_options = argparser.add_argument_group('Miscellaneous options')
214214

215215
# Output directory options
216+
output_options.add_argument(
217+
'--compress-report', action='store_true',
218+
help='Compress the run report file',
219+
envvar='RFM_COMPRESS_REPORT', configvar='general/compress_report'
220+
)
216221
output_options.add_argument(
217222
'--dont-restage', action='store_false', dest='clean_stagedir',
218223
help='Reuse the test stage directory',
@@ -1323,8 +1328,11 @@ def module_unuse(*paths):
13231328
report_file = runreport.next_report_filename(report_file)
13241329
try:
13251330
with open(report_file, 'w') as fp:
1326-
jsonext.dump(json_report, fp, indent=2)
1327-
fp.write('\n')
1331+
if rt.get_option('general/0/compress_report'):
1332+
jsonext.dump(json_report, fp)
1333+
else:
1334+
jsonext.dump(json_report, fp, indent=2)
1335+
fp.write('\n')
13281336

13291337
printer.info(f'Run report saved in {report_file!r}')
13301338
except OSError as e:

reframe/frontend/executors/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def generate_testcases(checks, prepare=False):
111111
'''Generate concrete test cases from checks.
112112
113113
If `prepare` is true then each of the cases will also be prepared for
114-
being sent to the test pipeline. Note that setting this true may slow down
114+
being sent to the test pipeline. Note that setting this to true may slow down
115115
the test case generation.
116116
117117
'''

reframe/frontend/runreport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# The schema data version
1919
# Major version bumps are expected to break the validation of previous schemas
2020

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

2424

reframe/frontend/statistics.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,22 @@ def json(self, force=False):
191191
'value': val
192192
})
193193

194+
# Add any loggable variables and parameters
195+
entry['check_vars'] = {}
196+
test_cls = type(check)
197+
for name, var in test_cls.var_space.items():
198+
if var.is_loggable():
199+
try:
200+
entry['check_vars'][name] = getattr(check, name)
201+
except AttributeError:
202+
entry['check_vars'][name] = '<undefined>'
203+
204+
entry['check_params'] = {}
205+
test_cls = type(check)
206+
for name, param in test_cls.param_space.items():
207+
if param.is_loggable():
208+
entry['check_params'][name] = getattr(check, name)
209+
194210
testcases.append(entry)
195211

196212
self._run_data.append({

reframe/schemas/config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@
466466
"clean_stagedir": {"type": "boolean"},
467467
"colorize": {"type": "boolean"},
468468
"compact_test_names": {"type": "boolean"},
469+
"compress_report": {"type": "boolean"},
469470
"git_timeout": {"type": "number"},
470471
"ignore_check_conflicts": {"type": "boolean"},
471472
"keep_stage_files": {"type": "boolean"},
@@ -519,6 +520,7 @@
519520
"general/clean_stagedir": true,
520521
"general/colorize": true,
521522
"general/compact_test_names": false,
523+
"general/compress_report": false,
522524
"general/git_timeout": 5,
523525
"general/ignore_check_conflicts": false,
524526
"general/keep_stage_files": false,

reframe/schemas/runreport.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"properties": {
99
"build_stderr": {"type": ["string", "null"]},
1010
"build_stdout": {"type": ["string", "null"]},
11+
"check_params": {"type": "object"},
12+
"check_vars": {"type": "object"},
1113
"dependencies_actual": {
1214
"type": "array",
1315
"items": {

unittests/resources/checks/frontend_checks.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ class BaseFrontendCheck(rfm.RunOnlyRegressionTest):
2323
executable = 'echo hello && echo perf: 10 Gflop/s'
2424
local = True
2525

26+
# Add two required variables that may affect the final run report
27+
x = variable(int)
28+
xlog = variable(int, loggable=True)
29+
30+
@run_after('setup')
31+
def setx(self):
32+
self.x = 1
33+
self.xlog = 1
34+
2635
@sanity_function
2736
def validate_output(self):
2837
return sn.assert_found('hello', self.stdout)

unittests/test_schedulers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ def _read_pid(job, attempts=3):
616616
f'{attempts} attempts')
617617

618618

619+
@pytest.mark.flaky(reruns=3)
619620
def test_cancel_with_grace(minimal_job, scheduler, local_only):
620621
# This test emulates a spawned process that ignores the SIGTERM signal
621622
# and also spawns another process:

0 commit comments

Comments
 (0)