Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion easybuild/framework/easyconfig/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _eb_check_trailing_whitespace(physical_line, lines, line_number, checker_sta

# if the warning is about the multiline string of description
# we will not issue a warning
if checker_state.get('eb_last_key') == 'description':
if checker_state.get('eb_last_key') in ['description', 'examples', 'citing']:
result = None

return result
Expand Down
6 changes: 6 additions & 0 deletions easybuild/framework/easyconfig/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,15 @@ def parse_easyconfigs(paths, validate=True):
"""
easyconfigs = []
generated_ecs = False
parsed_paths = []

for (path, generated) in paths:
# Avoid processing the same file multiple times
path = os.path.abspath(path)
if any(os.path.samefile(path, p) for p in parsed_paths):
continue
parsed_paths.append(path)

# keep track of whether any files were generated
generated_ecs |= generated
if not os.path.exists(path):
Expand Down
26 changes: 26 additions & 0 deletions test/framework/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,32 @@ def test_tweaking(self):
# cleanup
os.remove(tweaked_fn)

def test_parse_easyconfig(self):
"""Test parse_easyconfig function"""
self.contents = textwrap.dedent("""
easyblock = "ConfigureMake"
name = "PI"
version = "3.14"
homepage = "http://example.com"
description = "test easyconfig"
toolchain = SYSTEM
""")
self.prep()
ecs, gen_ecs = parse_easyconfigs([(self.eb_file, False)])
self.assertEqual(len(ecs), 1)
self.assertEqual(ecs[0]['spec'], self.eb_file)
self.assertIsInstance(ecs[0]['ec'], EasyConfig)
self.assertFalse(gen_ecs)
# Passing the same EC multiple times is ignored
ecs, gen_ecs = parse_easyconfigs([(self.eb_file, False), (self.eb_file, False)])
self.assertEqual(len(ecs), 1)
# Similar for symlinks
linked_ec = os.path.join(self.test_prefix, 'linked.eb')
os.symlink(self.eb_file, linked_ec)
ecs, gen_ecs = parse_easyconfigs([(self.eb_file, False), (linked_ec, False)])
self.assertEqual(len(ecs), 1)
self.assertEqual(ecs[0]['spec'], self.eb_file)

def test_alt_easyconfig_paths(self):
"""Test alt_easyconfig_paths function that collects list of additional paths for easyconfig files."""

Expand Down
12 changes: 12 additions & 0 deletions test/framework/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ def test_check_trailing_whitespace(self):
'''description = """start of long description, ''', # trailing whitespace, but allowed in description
''' continuation of long description ''', # trailing whitespace, but allowed in continued description
''' end of long description"""''',
'''citing = """start of long citing text, ''', # trailing whitespace, but allowed in citing
''' continuation of long citing text ''', # trailing whitespace, but allowed in continued citing
''' end of long citing text"""''',
'''examples = """start of long examples, ''', # trailing whitespace, but allowed in examples
''' continuation of long examples ''', # trailing whitespace, but allowed in continued examples
''' end of long examples"""''',
"moduleclass = 'tools' ", # trailing whitespace
'',
]
Expand All @@ -86,6 +92,12 @@ def test_check_trailing_whitespace(self):
None,
None,
None,
None,
None,
None,
None,
None,
None,
(21, "W299 trailing whitespace"),
]

Expand Down
3 changes: 2 additions & 1 deletion test/framework/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ def loadTestsFromTestCase(self, test_case_class, filters):
retained_test_names = []
if len(filters) > 0:
for test_case_name in test_case_names:
if any(filt in test_case_name for filt in filters):
full_test_case_name = '%s.%s' % (test_case_class.__name__, test_case_name)
if any(filt in full_test_case_name for filt in filters):
retained_test_names.append(test_case_name)

retained_tests = ', '.join(retained_test_names)
Expand Down
Loading