Skip to content

Commit 4c26eee

Browse files
authored
Merge pull request #16 from boegel/fix_modaltsoftname
add test for modaltsoftname fix & rename variable to better fit its contents
2 parents b7396e6 + 1c8af62 commit 4c26eee

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

easybuild/framework/easyblock.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,13 +1519,13 @@ def fetch_step(self, skip_checksums=False):
15191519
# create parent dirs in install and modules path already
15201520
# this is required when building in parallel
15211521
mod_symlink_paths = ActiveMNS().det_module_symlink_paths(self.cfg)
1522-
parent_subdir = os.path.dirname(ActiveMNS().det_full_module_name(self.cfg))
1522+
mod_subdir = os.path.dirname(ActiveMNS().det_full_module_name(self.cfg))
15231523
pardirs = [
15241524
self.installdir,
1525-
os.path.join(self.installdir_mod, parent_subdir),
1525+
os.path.join(self.installdir_mod, mod_subdir),
15261526
]
15271527
for mod_symlink_path in mod_symlink_paths:
1528-
pardirs.append(os.path.join(install_path('mod'), mod_symlink_path, parent_subdir))
1528+
pardirs.append(os.path.join(install_path('mod'), mod_symlink_path, mod_subdir))
15291529

15301530
self.log.info("Checking dirs that need to be created: %s" % pardirs)
15311531
for pardir in pardirs:

test/framework/toy_build.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,15 +1282,36 @@ def test_toy_modaltsoftname(self):
12821282
toy_ec_txt,
12831283
"versionsuffix = '-two'",
12841284
"dependencies = [('toy', '0.0', '-one')]",
1285+
"modaltsoftname = 'toytwo'",
12851286
])
12861287
write_file(ec2, ec2_txt)
12871288

12881289
extra_args = [
12891290
'--module-naming-scheme=HierarchicalMNS',
1290-
'--robot-paths=%s'%self.test_prefix,
1291+
'--robot-paths=%s' % self.test_prefix,
12911292
]
12921293
self.test_toy_build(ec_file=self.test_prefix, verify=False, extra_args=extra_args, raise_error=True)
12931294

1295+
software_path = os.path.join(self.test_installpath, 'software', 'Core')
1296+
modules_path = os.path.join(self.test_installpath, 'modules', 'all', 'Core')
1297+
1298+
# install dirs for both installations should be there (using original software name)
1299+
self.assertTrue(os.path.exists(os.path.join(software_path, 'toy', '0.0-one', 'bin', 'toy')))
1300+
self.assertTrue(os.path.exists(os.path.join(software_path, 'toy', '0.0-two', 'bin', 'toy')))
1301+
1302+
# modules for both installations with alternative name should be there
1303+
self.assertTrue(os.path.exists(os.path.join(modules_path, 'toytwo', '0.0-two.lua')))
1304+
self.assertTrue(os.path.exists(os.path.join(modules_path, 'yot', '0.0-one.lua')))
1305+
1306+
# only subdirectories for software should be created
1307+
self.assertEqual(os.listdir(software_path), ['toy'])
1308+
self.assertEqual(sorted(os.listdir(os.path.join(software_path, 'toy'))), ['0.0-one', '0.0-two'])
1309+
1310+
# only subdirectories for modules with alternative names should be created
1311+
self.assertEqual(sorted(os.listdir(modules_path)), ['toytwo', 'yot'])
1312+
self.assertEqual(os.listdir(os.path.join(modules_path, 'toytwo')), ['0.0-two.lua'])
1313+
self.assertEqual(os.listdir(os.path.join(modules_path, 'yot')), ['0.0-one.lua'])
1314+
12941315

12951316
def suite():
12961317
""" return all the tests in this file """

0 commit comments

Comments
 (0)