Skip to content

Commit ae47402

Browse files
committed
Skip test_toy_toy test with EnvironmentModules
"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.
1 parent 581041f commit ae47402

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193
# run test suite
194194
python -O -m test.framework.suite 2>&1 | tee test_framework_suite.log
195195
# try and make sure output of running tests is clean (no printed messages/warnings)
196-
IGNORE_PATTERNS="no GitHub token available|skipping SvnRepository test|requires Lmod as modules tool|stty: 'standard input': Inappropriate ioctl for device|CryptographyDeprecationWarning: Python 3.[56]|from cryptography.* import |CryptographyDeprecationWarning: Python 2|Blowfish|GC3Pie not available, skipping test"
196+
IGNORE_PATTERNS="no GitHub token available|skipping SvnRepository test|requires Lmod as modules tool|stty: 'standard input': Inappropriate ioctl for device|CryptographyDeprecationWarning: Python 3.[56]|from cryptography.* import |CryptographyDeprecationWarning: Python 2|Blowfish|GC3Pie not available, skipping test|Skipping test_toy_toy because Environment Modules is being used"
197197
# '|| true' is needed to avoid that GitHub Actions stops the job on non-zero exit of grep (i.e. when there are no matches)
198198
PRINTED_MSG=$(egrep -v "${IGNORE_PATTERNS}" test_framework_suite.log | grep '\.\n*[A-Za-z]' || true)
199199
test "x$PRINTED_MSG" = "x" || (echo "ERROR: Found printed messages in output of test suite" && echo "${PRINTED_MSG}" && exit 1)

test/framework/toy_build.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
from easybuild.tools.filetools import adjust_permissions, change_dir, copy_file, mkdir, move_file
5656
from easybuild.tools.filetools import read_file, remove_dir, remove_file, which, write_file
5757
from easybuild.tools.module_generator import ModuleGeneratorTcl
58-
from easybuild.tools.modules import Lmod
58+
from easybuild.tools.modules import EnvironmentModules, Lmod
5959
from easybuild.tools.py2vs3 import reload, string_type
6060
from easybuild.tools.run import run_cmd
6161
from easybuild.tools.utilities import nub
@@ -2245,6 +2245,13 @@ def test_reproducibility_ext_easyblocks(self):
22452245

22462246
def test_toy_toy(self):
22472247
"""Test building two easyconfigs in a single go, with one depending on the other."""
2248+
2249+
# skip when using Environment Modules tool, since this test generates an inconsistent environment
2250+
# (two modules with same name, expressing a reflexive conflict, one loading the other)
2251+
if isinstance(self.modtool, EnvironmentModules):
2252+
print("Skipping test_toy_toy because Environment Modules is being used")
2253+
return
2254+
22482255
topdir = os.path.dirname(os.path.abspath(__file__))
22492256
toy_ec_file = os.path.join(topdir, 'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0.eb')
22502257
toy_ec_txt = read_file(toy_ec_file)

0 commit comments

Comments
 (0)