Skip to content

Commit 1fef416

Browse files
author
Vasileios Karakasis
committed
Merge branch 'master' into undefined-poll-rate
2 parents 8ced0d0 + 59217e7 commit 1fef416

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

reframe/frontend/argparse.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ def add_argument(self, *flags, **kwargs):
184184
kwargs['dest'] = opt_name
185185

186186
# Convert 'store_true' and 'store_false' actions to their
187-
# 'store_const' equivalents, because they otherwise imply imply a
188-
# default
187+
# 'store_const' equivalents, because they otherwise imply a default
189188
action = kwargs.get('action', None)
190189
if action == 'store_true' or action == 'store_false':
191190
kwargs['action'] = 'store_const'

reframe/frontend/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ def main():
217217
envvar='RFM_SAVE_LOG_FILES', configvar='general/save_log_files'
218218
)
219219
output_options.add_argument(
220-
'--timestamp', action='store', nargs='?', const='', metavar='TIMEFMT',
220+
'--timestamp', action='store', nargs='?', const='%FT%T',
221+
metavar='TIMEFMT',
221222
help=('Append a timestamp to the output and stage directory prefixes '
222223
'(default: "%%FT%%T")'),
223224
envvar='RFM_TIMESTAMP_DIRS', configvar='general/timestamp_dirs'

unittests/test_cli.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import pytest
1212
import re
1313
import sys
14+
import time
1415

1516
import reframe.core.environments as env
1617
import reframe.frontend.runreport as runreport
@@ -474,9 +475,7 @@ def test_execution_modes(run_reframe):
474475

475476

476477
def test_timestamp_option(run_reframe):
477-
from datetime import datetime
478-
479-
timefmt = datetime.now().strftime('xxx_%F')
478+
timefmt = time.strftime('xxx_%F')
480479
returncode, stdout, _ = run_reframe(
481480
checkpath=['unittests/resources/checks'],
482481
action='list',
@@ -486,6 +485,17 @@ def test_timestamp_option(run_reframe):
486485
assert timefmt in stdout
487486

488487

488+
def test_timestamp_option_default(run_reframe):
489+
timefmt_date_part = time.strftime('%FT')
490+
returncode, stdout, _ = run_reframe(
491+
checkpath=['unittests/resources/checks'],
492+
action='list',
493+
more_options=['-R', '--timestamp']
494+
)
495+
assert returncode == 0
496+
assert timefmt_date_part in stdout
497+
498+
489499
def test_list_empty_prgenvs_check_and_options(run_reframe):
490500
returncode, stdout, _ = run_reframe(
491501
checkpath=['unittests/resources/checks/frontend_checks.py'],

0 commit comments

Comments
 (0)