Skip to content

Commit

Permalink
Skip test_toy_toy test with EnvironmentModules
Browse files Browse the repository at this point in the history
"test_toy_toy" test generates two versions of "toy" module. Both modules
express a reflexive conflict (against "toy") and toy/0.0-two loads
toy/0.0-one.

As these two modules share the same name ("toy") and due to the
reflexive conflict they express, environment obtained when loading
toy/0.0-two is inconsistent as it tries to load toy/0.0-one.

Environment Modules version 4.2 (and above) detects this inconsistency
and raise an error unless --force option is set.

"test_toy_toy" test is adapted to be skipped when Environment Modules
tool is used, as the environment generated by the test produces an error
with this module tool.
  • Loading branch information
xdelaruelle committed Aug 18, 2024
1 parent 4c5b6fd commit 877f3ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ jobs:
IGNORE_PATTERNS+="|GC3Pie not available, skipping test"
IGNORE_PATTERNS+="|CryptographyDeprecationWarning: TripleDES has been moved"
IGNORE_PATTERNS+="|algorithms.TripleDES"
IGNORE_PATTERNS+="|Skipping test_toy_toy because Environment Modules is being used"
# '|| true' is needed to avoid that GitHub Actions stops the job on non-zero exit of grep (i.e. when there are no matches)
PRINTED_MSG=$(egrep -v "${IGNORE_PATTERNS}" test_framework_suite.log | grep '\.\n*[A-Za-z]' || true)
test "x$PRINTED_MSG" = "x" || (echo "ERROR: Found printed messages in output of test suite" && echo "${PRINTED_MSG}" && exit 1)
Expand Down
9 changes: 8 additions & 1 deletion test/framework/toy_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
from easybuild.tools.filetools import adjust_permissions, change_dir, copy_file, mkdir, move_file
from easybuild.tools.filetools import read_file, remove_dir, remove_file, which, write_file
from easybuild.tools.module_generator import ModuleGeneratorTcl
from easybuild.tools.modules import Lmod
from easybuild.tools.modules import EnvironmentModules, Lmod
from easybuild.tools.run import run_shell_cmd
from easybuild.tools.utilities import nub
from easybuild.tools.systemtools import get_shared_lib_ext
Expand Down Expand Up @@ -2317,6 +2317,13 @@ def test_reproducibility_ext_easyblocks(self):

def test_toy_toy(self):
"""Test building two easyconfigs in a single go, with one depending on the other."""

# skip when using Environment Modules tool, since this test generates an inconsistent environment
# (two modules with same name, expressing a reflexive conflict, one loading the other)
if isinstance(self.modtool, EnvironmentModules):
print("Skipping test_toy_toy because Environment Modules is being used")
return

topdir = os.path.dirname(os.path.abspath(__file__))
toy_ec_file = os.path.join(topdir, 'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0.eb')
toy_ec_txt = read_file(toy_ec_file)
Expand Down

0 comments on commit 877f3ce

Please sign in to comment.