Skip to content

Commit

Permalink
Merge pull request easybuilders#3426 from boegel/require_run_shell_cmd
Browse files Browse the repository at this point in the history
add check to make sure that easyblocks do not use `run_cmd` or `run_cmd_qa`
  • Loading branch information
branfosj authored Aug 29, 2024
2 parents 068d8ea + ed69d2f commit 63ad773
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/easyblocks/init_easyblocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ def check_extra_options_format(extra_options):
if hasattr(mod, fn):
tup = (fn, app.__module__, globals()[fn].__module__)
self.assertTrue(getattr(mod, fn) is globals()[fn], "%s in %s is imported from %s" % tup)

# check whether easyblock instance is still using run_cmd or run_cmd_qa
for fn in ('run_cmd', 'run_cmd_qa'):
error_msg = "%s easyblock is still using %s" % (app.__module__, fn)
error_msg += ", should be using run_shell_cmd instead"
self.assertFalse(hasattr(mod, fn), error_msg)

# check whether easyblock instance is using functions that have been renamed
renamed_functions = [
('source_paths', 'source_path'),
('get_avail_core_count', 'get_core_count'),
Expand Down

0 comments on commit 63ad773

Please sign in to comment.