Skip to content

Commit

Permalink
add test to check easyconfig that would be picked by 'eb --install-la…
Browse files Browse the repository at this point in the history
…test-eb-release'
  • Loading branch information
boegel committed Dec 21, 2024
1 parent 8d6a293 commit 0fb89ce
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/easyconfigs/easyconfigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,30 @@ def test_easyconfig_locations(self):
if not dirpath.endswith('/easybuild/easyconfigs'):
self.fail("There should be no easyconfig files in %s, found %s" % (dirpath, easyconfig_files))

def test_easybuild_easyconfigs_latest_release(self):
"""
Check which easyconfig file would be picked up by 'eb --install-latest-eb-release'
"""
# this mimics the logic used in the find_easybuild_easyconfig used by EasyBuild framework
# to obtain an easyconfig file when --install-latest-eb-release is used
topdir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
easybuild_dir = os.path.join(topdir, 'easybuild', 'easyconfigs', 'e', 'EasyBuild')
ecs = os.listdir(easybuild_dir)

file_versions = []
for ec in ecs:
txt = read_file(os.path.join(easybuild_dir, ec))
for line in txt.split('\n'):
if re.search(r'^version\s*=', line):
scope = {}
exec(line, scope)
version = scope['version']
file_versions.append((LooseVersion(version), ec))

most_recent = sorted(file_versions)[-1]
self.assertEqual(most_recent[0], LooseVersion('4.9.4'))
self.assertEqual(most_recent[1], 'EasyBuild-4.9.4.eb')

def test_easyconfig_name_clashes(self):
"""Make sure there is not a name clash when all names are lowercase"""
topdir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
Expand Down

0 comments on commit 0fb89ce

Please sign in to comment.