Skip to content

Commit 7b0b55e

Browse files
committed
add test_extension_fake_modules to test.framework.easyblock
1 parent e954997 commit 7b0b55e

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

test/framework/easyblock.py

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,6 @@ def test_extensions_step_deprecations(self):
13181318
'description = "test easyconfig"',
13191319
'toolchain = SYSTEM',
13201320
'exts_defaultclass = "DummyExtension"',
1321-
'exts_list = ["ext1"]',
13221321
'exts_list = [',
13231322
' "dummy_ext",',
13241323
' ("custom_ext", "0.0", {"easyblock": "CustomDummyExtension"}),',
@@ -1410,7 +1409,7 @@ def test_extension_source_tmpl(self):
14101409
"toolchain = SYSTEM",
14111410
"exts_list = [",
14121411
" ('bar', '0.0', {",
1413-
" 'source_tmpl': [SOURCE_TAR_GZ],",
1412+
" 'source_tmpl': [SOURCE_TAR_GZ],",
14141413
" }),",
14151414
"]",
14161415
])
@@ -1484,6 +1483,46 @@ def test_skip_extensions_step(self):
14841483
eb.close_log()
14851484
os.remove(eb.logfile)
14861485

1486+
def test_extension_fake_modules(self):
1487+
"""
1488+
Test that extensions relying on installation files from previous extensions work
1489+
Search paths of fake module should update for each extension and resolve any globs
1490+
"""
1491+
self.contents = cleandoc("""
1492+
easyblock = 'ConfigureMake'
1493+
name = 'toy'
1494+
version = '0.0'
1495+
homepage = 'https://example.com'
1496+
description = 'test'
1497+
toolchain = SYSTEM
1498+
exts_list = [
1499+
('bar', '0.0', {
1500+
'postinstallcmds': [
1501+
'mkdir -p %(installdir)s/custom_bin',
1502+
'touch %(installdir)s/custom_bin/bar.sh',
1503+
'chmod +x %(installdir)s/custom_bin/bar.sh',
1504+
],
1505+
}),
1506+
('barbar', '0.0', {
1507+
'postinstallcmds': ['bar.sh'],
1508+
}),
1509+
]
1510+
exts_defaultclass = "DummyExtension"
1511+
modextrapaths = {'PATH': 'custom*'}
1512+
""")
1513+
self.writeEC()
1514+
eb = EasyBlock(EasyConfig(self.eb_file))
1515+
eb.builddir = config.build_path()
1516+
eb.installdir = config.install_path()
1517+
1518+
self.mock_stdout(True)
1519+
eb.extensions_step(fetch=True)
1520+
stdout = self.get_stdout()
1521+
self.mock_stdout(False)
1522+
1523+
pattern = r">> running shell command:\n\s+bar.sh(\n\s+\[.*\]){3}\n\s+>> command completed: exit 0"
1524+
self.assertTrue(re.search(pattern, stdout, re.M))
1525+
14871526
def test_make_module_step(self):
14881527
"""Test the make_module_step"""
14891528

0 commit comments

Comments
 (0)