Skip to content

Commit

Permalink
Merge pull request #2280 from lexming/default-extra-opt
Browse files Browse the repository at this point in the history
prefer default value for extra options in easyblock tests
  • Loading branch information
migueldiascosta authored Dec 15, 2020
2 parents 7ee2896 + 643a301 commit 803b3ec
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/easyblocks/init_easyblocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,16 @@ def check_extra_options_format(extra_options):
extra_options = app_class.extra_options()
check_extra_options_format(extra_options)

# extend easyconfig to make sure mandatory custom easyconfig paramters are defined
# extend easyconfig to make sure mandatory custom easyconfig parameters are defined
extra_txt = ''
for (key, val) in extra_options.items():
if val[2] == MANDATORY:
extra_txt += '%s = "foo"\n' % key
# use default value if any is set, otherwise use "foo"
if val[0]:
test_param = val[0]
else:
test_param = 'foo'
extra_txt += '%s = "%s"\n' % (key, test_param)

# write easyconfig file
self.writeEC(ebname, name=name, version=version, extratxt=extra_txt)
Expand Down

0 comments on commit 803b3ec

Please sign in to comment.