Skip to content

Commit faab025

Browse files
author
Vasileios Karakasis
authored
Merge pull request #2546 from vkarak/bugfix/runreport-treat-undefined-vars
[bugfix] Treat undefined variables correctly in run report
2 parents 1be1749 + b268ff2 commit faab025

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

reframe/frontend/statistics.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ def json(self, force=False):
196196
test_cls = type(check)
197197
for name, var in test_cls.var_space.items():
198198
if var.is_loggable():
199-
entry['check_vars'][name] = getattr(check, name)
199+
try:
200+
entry['check_vars'][name] = getattr(check, name)
201+
except AttributeError:
202+
entry['check_vars'][name] = '<undefined>'
200203

201204
entry['check_params'] = {}
202205
test_cls = type(check)

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)