Skip to content

Commit

Permalink
Merge pull request #1970 from boegel/reorganise_test_easyconfigs
Browse files Browse the repository at this point in the history
reorganise test easyconfigs to match structure in easyconfigs repo
  • Loading branch information
boegel authored Oct 27, 2016
2 parents b0ef380 + 6809e4a commit a2e6645
Show file tree
Hide file tree
Showing 68 changed files with 263 additions and 210 deletions.
34 changes: 18 additions & 16 deletions test/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def test_get_easyblock_instance(self):
from easybuild.easyblocks.toy import EB_toy
testdir = os.path.abspath(os.path.dirname(__file__))

ec = process_easyconfig(os.path.join(testdir, 'easyconfigs', 'toy-0.0.eb'))[0]
ec = process_easyconfig(os.path.join(testdir, 'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0.eb'))[0]
eb = get_easyblock_instance(ec)
self.assertTrue(isinstance(eb, EB_toy))

Expand All @@ -652,7 +652,7 @@ def test_fetch_patches(self):
"""Test fetch_patches method."""
# adjust PYTHONPATH such that test easyblocks are found
testdir = os.path.abspath(os.path.dirname(__file__))
ec = process_easyconfig(os.path.join(testdir, 'easyconfigs', 'toy-0.0.eb'))[0]
ec = process_easyconfig(os.path.join(testdir, 'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0.eb'))[0]
eb = get_easyblock_instance(ec)

eb.fetch_patches()
Expand Down Expand Up @@ -698,7 +698,7 @@ def test_obtain_file(self):
mkdir(tmpdir_subdir, parents=True)
del os.environ['EASYBUILD_SOURCEPATH'] # defined by setUp

ec = process_easyconfig(os.path.join(testdir, 'easyconfigs', 'toy-0.0.eb'))[0]
ec = process_easyconfig(os.path.join(testdir, 'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0.eb'))[0]
eb = EasyBlock(ec['ec'])

# 'downloading' a file to (first) sourcepath works
Expand Down Expand Up @@ -752,7 +752,8 @@ def test_check_readiness(self):

# check that check_readiness step works (adding dependencies, etc.)
ec_file = 'OpenMPI-1.6.4-GCC-4.6.4.eb'
ec_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', ec_file)
topdir = os.path.dirname(os.path.abspath(__file__))
ec_path = os.path.join(topdir, 'easyconfigs', 'test_ecs', 'o', 'OpenMPI', ec_file)
ec = EasyConfig(ec_path)
eb = EasyBlock(ec)
eb.check_readiness_step()
Expand Down Expand Up @@ -780,7 +781,7 @@ def test_exclude_path_to_top_of_module_tree(self):
w.r.t. not including any load statements for modules that build up the path to the top of the module tree.
"""
self.orig_module_naming_scheme = config.get_module_naming_scheme()
test_ecs_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs')
test_ecs_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'easyconfigs', 'test_ecs')
all_stops = [x[0] for x in EasyBlock.get_steps()]
build_options = {
'check_osdeps': False,
Expand All @@ -804,8 +805,8 @@ def test_exclude_path_to_top_of_module_tree(self):
# since both icc/ifort and impi form the path to the top of the module tree
iccifort_mods = ['icc', 'ifort', 'iccifort']
tests = [
('impi-4.1.3.049-iccifort-2013.5.192-GCC-4.8.3.eb', impi_modfile_path, iccifort_mods),
('imkl-11.1.2.144-iimpi-5.5.3-GCC-4.8.3.eb', imkl_modfile_path, iccifort_mods + ['iimpi', 'impi']),
('i/impi/impi-4.1.3.049-iccifort-2013.5.192-GCC-4.8.3.eb', impi_modfile_path, iccifort_mods),
('i/imkl/imkl-11.1.2.144-iimpi-5.5.3-GCC-4.8.3.eb', imkl_modfile_path, iccifort_mods + ['iimpi', 'impi']),
]
for ec_file, modfile_path, excluded_deps in tests:
ec = EasyConfig(os.path.join(test_ecs_path, ec_file))
Expand Down Expand Up @@ -839,8 +840,8 @@ def test_exclude_path_to_top_of_module_tree(self):

def test_patch_step(self):
"""Test patch step."""
test_easyconfigs = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs')
ec = process_easyconfig(os.path.join(test_easyconfigs, 'toy-0.0.eb'))[0]
test_easyconfigs = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs', 'test_ecs')
ec = process_easyconfig(os.path.join(test_easyconfigs, 't', 'toy', 'toy-0.0.eb'))[0]
orig_sources = ec['ec']['sources'][:]

toy_patches = [
Expand Down Expand Up @@ -870,8 +871,8 @@ def test_patch_step(self):

def test_extensions_sanity_check(self):
"""Test sanity check aspect of extensions."""
test_ecs_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs')
toy_ec = EasyConfig(os.path.join(test_ecs_dir, 'toy-0.0-gompi-1.3.12-test.eb'))
test_ecs_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs', 'test_ecs')
toy_ec = EasyConfig(os.path.join(test_ecs_dir, 't', 'toy', 'toy-0.0-gompi-1.3.12-test.eb'))

# purposely put sanity check command in place that breaks the build,
# to check whether sanity check is only run once;
Expand All @@ -886,7 +887,8 @@ def test_extensions_sanity_check(self):

def test_parallel(self):
"""Test defining of parallellism."""
toy_ec = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs', 'toy-0.0.eb')
topdir = os.path.abspath(os.path.dirname(__file__))
toy_ec = os.path.join(topdir, 'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0.eb')
toytxt = read_file(toy_ec)

handle, toy_ec1 = tempfile.mkstemp(prefix='easyblock_test_file_', suffix='.eb')
Expand Down Expand Up @@ -930,8 +932,8 @@ def test_parallel(self):

def test_guess_start_dir(self):
"""Test guessing the start dir."""
test_easyconfigs = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs')
ec = process_easyconfig(os.path.join(test_easyconfigs, 'toy-0.0.eb'))[0]
test_easyconfigs = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs', 'test_ecs')
ec = process_easyconfig(os.path.join(test_easyconfigs, 't', 'toy', 'toy-0.0.eb'))[0]

def check_start_dir(expected_start_dir):
"""Check start dir."""
Expand Down Expand Up @@ -960,8 +962,8 @@ def check_start_dir(expected_start_dir):

def test_prepare_step(self):
"""Test prepare step (setting up build environment)."""
test_easyconfigs = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs')
ec = process_easyconfig(os.path.join(test_easyconfigs, 'toy-0.0.eb'))[0]
test_easyconfigs = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs', 'test_ecs')
ec = process_easyconfig(os.path.join(test_easyconfigs, 't', 'toy', 'toy-0.0.eb'))[0]

mkdir(os.path.join(self.test_buildpath, 'toy', '0.0', 'dummy-dummy'), parents=True)
eb = EasyBlock(ec['ec'])
Expand Down
Loading

0 comments on commit a2e6645

Please sign in to comment.