Skip to content

Commit

Permalink
EnvironmentModules now correctly set a non-zero exit code
Browse files Browse the repository at this point in the history
Starting Environment Modules v5.5, a non-zero exit code is set by
modulecmd.tcl when trying to load a non-existing module.
  • Loading branch information
xdelaruelle committed Jan 8, 2025
1 parent 25a367e commit 2981e02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/framework/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ 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,
# we need to use a different error pattern here with EnvironmentModulesC,
# 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):
if isinstance(self.modtool, EnvironmentModulesC):
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

0 comments on commit 2981e02

Please sign in to comment.