@@ -165,6 +165,17 @@ def _format_time_rfc3339(timestamp, datefmt):
165165
166166
167167def _xfmt (val ):
168+ from reframe .core .deferrable import _DeferredExpression
169+
170+ if val is None :
171+ return '<undefined>'
172+
173+ if isinstance (val , _DeferredExpression ):
174+ try :
175+ return val .evaluate ()
176+ except BaseException :
177+ return '<error>'
178+
168179 if isinstance (val , str ):
169180 return val
170181
@@ -222,7 +233,7 @@ def formatTime(self, record, datefmt=None):
222233
223234 def format (self , record ):
224235 datefmt = self .datefmt or self .default_time_format
225- if record .check_job_completion_time_unix is not None :
236+ if record .check_job_completion_time_unix != _xfmt ( None ) :
226237 ct = self .converter (record .check_job_completion_time_unix )
227238 record .check_job_completion_time = _format_time_rfc3339 (
228239 ct , datefmt
@@ -437,21 +448,21 @@ def __init__(self, logger=None, check=None):
437448 # Here we only set the format specifiers that do not
438449 # correspond directly to check attributes
439450 'check' : check ,
440- 'check_jobid' : '-1' ,
441- 'check_job_completion_time' : None ,
442- 'check_job_completion_time_unix' : None ,
451+ 'check_jobid' : _xfmt ( None ) ,
452+ 'check_job_completion_time' : _xfmt ( None ) ,
453+ 'check_job_completion_time_unix' : _xfmt ( None ) ,
443454 'check_info' : 'reframe' ,
444- 'check_system' : None ,
445- 'check_partition' : None ,
446- 'check_environ' : None ,
447- 'check_perf_var' : None ,
448- 'check_perf_value' : None ,
449- 'check_perf_ref' : None ,
450- 'check_perf_lower_thres' : None ,
451- 'check_perf_upper_thres' : None ,
452- 'check_perf_unit' : None ,
453- 'osuser' : osext .osuser () or '<unknown>' ,
454- 'osgroup' : osext .osgroup () or '<unknown>' ,
455+ 'check_system' : _xfmt ( None ) ,
456+ 'check_partition' : _xfmt ( None ) ,
457+ 'check_environ' : _xfmt ( None ) ,
458+ 'check_perf_var' : _xfmt ( None ) ,
459+ 'check_perf_value' : _xfmt ( None ) ,
460+ 'check_perf_ref' : _xfmt ( None ) ,
461+ 'check_perf_lower_thres' : _xfmt ( None ) ,
462+ 'check_perf_upper_thres' : _xfmt ( None ) ,
463+ 'check_perf_unit' : _xfmt ( None ) ,
464+ 'osuser' : _xfmt ( osext .osuser ()) ,
465+ 'osgroup' : _xfmt ( osext .osgroup ()) ,
455466 'version' : osext .reframe_version (),
456467 }
457468 )
0 commit comments