Skip to content

Fix initialization order in ModulesTool, tests and don't set $LMOD_REDIRECT='no'#5079

Open
Flamefire wants to merge 5 commits intoeasybuilders:developfrom
Flamefire:module-cmd-tests
Open

Fix initialization order in ModulesTool, tests and don't set $LMOD_REDIRECT='no'#5079
Flamefire wants to merge 5 commits intoeasybuilders:developfrom
Flamefire:module-cmd-tests

Conversation

@Flamefire
Copy link
Contributor

self.set_mod_paths(mod_paths) calls the modules command which isn't fully initialized at this point.
This isn't caught as we don't pass that parameter in any usage (so far)

So move that around.

Also the test_lmod_specific might (almost?) always be skipped because lmod is not in $PATH, but only in $LMOD_CMD
Additionally parts of the modules-specific tests can be run even if that modules tool is not available. So only skip what has to be skipped.

Finally revert #1755: $LMOD_REDIRECT only affects the module function which we do not use. So do not set that variable to "no" which makes working in the debug shell easier.

Before calling any module function `self.cmd  must be initialized and
verified.
So modify `$MODULEPATH` after those checks.
Also don't skip the LMod specific tests if `lmod` is not in `$PATH`
which it usually is not.
In `test_environment_modules_specific` we can verify the `module`
function even if EnvironmentModules is not installed by using the fake command.
@boegel boegel added the bug fix label Jan 14, 2026
@boegel boegel added this to the next release (5.2.1?) milestone Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants