Skip to content

Commit a54740c

Browse files
authored
Merge pull request #3517 from jack-morrison/jackm/ref-if-declared
[enhancement] Print the performance reference tuple while running only if defined
2 parents d711e28 + b34fab8 commit a54740c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

docs/tutorial.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ The :ref:`logging` section article describes how logging can be configured in mo
163163
Once a performance test finishes, its figures of merit are printed immediately using the ``P:`` prefix.
164164
This can be suppressed by increasing the level at which this information is logged using the :envvar:`RFM_PERF_INFO_LEVEL` environment variable.
165165

166+
.. note::
167+
168+
.. versionchanged:: 4.9
169+
170+
If the test sets no references, then the reference tuples are not printed in the ``P:`` line.
171+
172+
166173
.. _run-reports-and-performance-logging:
167174

168175
Run reports and performance logging

reframe/frontend/executors/policies.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ def _print_perf(task):
5050
for key, info in perfvars.items():
5151
val, ref, lower, upper, unit, result = info
5252
name = key.split(':')[-1]
53-
msg = f'P: {name}: {val} {unit} (r:{ref}, l:{lower}, u:{upper})'
53+
54+
# Build reference info string only if reference is defined
55+
if ref == 0 and lower is None and upper is None:
56+
msg = f'P: {name}: {val} {unit}'
57+
else:
58+
msg = f'P: {name}: {val} {unit} (r:{ref}, l:{lower}, u:{upper})'
59+
5460
if result == 'xfail':
5561
msg = color.colorize(msg, color.MAGENTA)
5662
elif result == 'fail' or result == 'xpass':

0 commit comments

Comments
 (0)