Skip to content

Commit 3f16150

Browse files
author
Vasileios Karakasis
authored
Merge branch 'master' into bugfix/conversion_tool_perflogdir
2 parents 749ab3e + d955e48 commit 3f16150

File tree

8 files changed

+25
-10
lines changed

8 files changed

+25
-10
lines changed

docs/config_reference.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ General Configuration
10231023
.. option:: -R | --recursive
10241024

10251025
:required: No
1026-
:default: ``true``
1026+
:default: ``false``
10271027

10281028
Search directories in the `search path <#.general[].check_search_path>`__ recursively.
10291029

docs/migration_2_to_3.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,24 @@ As soon as it detects an old-style configuration file, it will convert it to the
2424
./bin/reframe: the syntax of the configuration file 'unittests/resources/settings_old_syntax.py' is deprecated
2525
./bin/reframe: configuration file has been converted to the new syntax here: '/var/folders/h7/k7cgrdl13r996m4dmsvjq7v80000gp/T/tmph5n8u3kf.py'
2626
27-
Alternatively, you can convert any old configuration file using the conversion tool ``tools/convert_config.py``:
27+
Alternatively, you can convert any old configuration file using the conversion tool |convert_config|_:
28+
29+
.. |convert_config| replace:: :obj:`convert-config`
30+
.. _convert_config: https://github.com/eth-cscs/reframe/blob/master/tools/convert-config
2831

2932
.. code-block:: none
3033
31-
$ ./tools/convert-config unittests/resources/settings_old_syntax.py
32-
Conversion successful! The converted file can be found at '/var/folders/h7/k7cgrdl13r996m4dmsvjq7v80000gp/T/tmpz4f6yer4.py'.
34+
$ ./tools/convert-config unittests/resources/settings_old_syntax.py new_config.py
35+
Conversion successful! The converted file can be found at 'new_config.py'.
3336
3437
3538
Another important change is that default locations for looking up a configuration file has changed (see `Configuring ReFrame for Your Site <configure.html>`__ for more details).
3639
That practically means that if you were relying on ReFrame loading your ``reframe/settings.py`` by default, this is no longer true.
3740
You have to move it to any of the default settings locations or set the corresponding command line option or environment variable.
3841

42+
.. note::
43+
The conversion tool will create a JSON configuration file if the extension of the target file is ``.json``.
44+
3945

4046
Automatic conversion limitations
4147
================================

reframe/core/config.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,16 @@ def handler_list(handler_config, basedir=None):
532532
f"by ReFrame based on '{filename}'.\n#\n\n"
533533
f"site_configuration = {util.ppretty(converted)}\n")
534534

535+
contents = '\n'.join(l if len(l) < 80 else f'{l} # noqa: E501'
536+
for l in contents.split('\n'))
537+
535538
if newfilename:
536539
with open(newfilename, 'w') as fp:
537-
fp.write(contents)
540+
if newfilename.endswith('.json'):
541+
json.dump(converted, fp, indent=4)
542+
else:
543+
fp.write(contents)
544+
538545
else:
539546
with tempfile.NamedTemporaryFile(mode='w', suffix='.py',
540547
delete=False) as fp:

reframe/frontend/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ def main():
332332
logging.getlogger().colorize = site_config.get('general/0/colorize')
333333
printer = PrettyPrinter()
334334
printer.colorize = site_config.get('general/0/colorize')
335-
if options.verbose:
336-
printer.inc_verbosity(options.verbose)
335+
printer.inc_verbosity(site_config.get('general/0/verbose'))
337336

338337
# Now configure ReFrame according to the user configuration file
339338
try:
@@ -360,6 +359,7 @@ def main():
360359

361360
logging.getlogger().colorize = site_config.get('general/0/colorize')
362361
printer.colorize = site_config.get('general/0/colorize')
362+
printer.inc_verbosity(site_config.get('general/0/verbose'))
363363
try:
364364
runtime.init_runtime(site_config)
365365
except ConfigError as e:

schemas/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@
386386
"environments/ldflags": [],
387387
"environments/target_systems": ["*"],
388388
"general/check_search_path": ["${RFM_INSTALL_PREFIX}/checks/"],
389-
"general/check_search_recursive": true,
389+
"general/check_search_recursive": false,
390390
"general/colorize": true,
391391
"general/ignore_check_conflicts": false,
392392
"general/keep_stage_files": false,

tools/convert_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
print(f'{sys.argv[0]}: too few arguments', file=sys.stderr)
2121
print(f'Usage: {sys.argv[0]} OLD_CONFIG_FILE [NEW_CONFIG_FILE]',
2222
file=sys.stderr)
23+
print(' Use the extension of NEW_CONFIG_FILE to specify\n'
24+
' python (.py) or json (.json) format.',
25+
file=sys.stderr)
2326
sys.exit(1)
2427

2528
try:

tutorial/config/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
'general': [
132132
{
133133
'check_search_path': ['tutorial/'],
134-
'check_search_recursive': True
135134
}
136135
]
137136
}

unittests/test_argparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def test_option_with_config(extended_parser):
156156
['--timestamp=%FT%T', '--nocolor']
157157
)
158158
options.update_config(site_config)
159-
assert site_config.get('general/0/check_search_recursive') is True
159+
assert site_config.get('general/0/check_search_recursive') is False
160160
assert site_config.get('general/0/timestamp_dirs') == '%FT%T'
161161
assert site_config.get('general/0/non_default_craype') is True
162162
assert site_config.get('systems/0/prefix') == '.'

0 commit comments

Comments
 (0)