Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion easybuild/tools/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,8 @@ def show(self, mod_name):
ans = MODULE_SHOW_CACHE[key]
self.log.debug("Found cached result for 'module show %s' with key '%s': %s", mod_name, key, ans)
else:
ans = self.run_module('show', mod_name, check_output=False, return_stderr=True)
ans = self.run_module('show', mod_name, check_output=False, return_stderr=True,
check_exit_code=False)
MODULE_SHOW_CACHE[key] = ans
self.log.debug("Cached result for 'module show %s' with key '%s': %s", mod_name, key, ans)

Expand Down
10 changes: 6 additions & 4 deletions test/framework/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ def test_run_module(self):
error_pattern = "Module command '.*thisdoesnotmakesense' failed with exit code [1-9]"
self.assertErrorRegex(EasyBuildError, error_pattern, self.modtool.run_module, 'thisdoesnotmakesense')

# we need to use a different error pattern here with Environment Modules,
# because a load of a non-existing module doesnt' trigger a non-zero exit code...
# it will still fail though, just differently
if isinstance(self.modtool, EnvironmentModulesC) or isinstance(self.modtool, EnvironmentModules):
# we need to use a different error pattern here with EnvironmentModulesC and
# EnvironmentModules <5.5, because a load of a non-existing module doesnt' trigger a
# non-zero exit code. it will still fail though, just differently
version = LooseVersion(self.modtool.version)
if (isinstance(self.modtool, EnvironmentModulesC)
or (isinstance(self.modtool, EnvironmentModules) and version < '5.5')):
error_pattern = "Unable to locate a modulefile for 'nosuchmodule/1.2.3'"
else:
error_pattern = "Module command '.*load nosuchmodule/1.2.3' failed with exit code [1-9]"
Expand Down
Loading