Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions test/easyconfigs/easyconfigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import shutil
import sys
import tempfile
from collections import defaultdict
from distutils.version import LooseVersion
from unittest import TestCase, TestLoader, main, skip

Expand Down Expand Up @@ -926,6 +927,27 @@ def test_easyconfig_locations(self):
if not (dirpath.endswith('/easybuild/easyconfigs') and filenames == ['TEMPLATE.eb']):
self.assertTrue(False, "List of easyconfig files in %s is empty: %s" % (dirpath, filenames))

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__)))
names = defaultdict(list)
# ignore git/svn dirs & archived easyconfigs
ignore_dirs = ['.git', '.svn', '__archive__']
for (dirpath, _, _) in os.walk(topdir):
if not any('/%s' % d in dirpath for d in ignore_dirs):
dirpath_split = dirpath.replace(topdir, '').split(os.sep)
if len(dirpath_split) == 5:
name = dirpath_split[4]
names[name.lower()].append(name)

duplicates = {}
for name in names:
if len(names[name]) > 1:
duplicates[name] = names[name]

if duplicates:
self.assertTrue(False, "EasyConfigs with case-insensitive name clash: %s" % duplicates)

@skip_if_not_pr_to_non_main_branch()
def test_pr_sha256_checksums(self):
"""Make sure changed easyconfigs have SHA256 checksums in place."""
Expand Down