Skip to content

Commit

Permalink
Implement the toy example with a single easyconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
gkaf89 committed Jan 12, 2025
1 parent 018bfa9 commit b43bcf5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 39 deletions.
1 change: 1 addition & 0 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -4208,6 +4208,7 @@ def print_dry_run_note(loc, silent=True):

def persist_failed_compilation_log_and_artifacts(build_successful, application_log, silent, app, easyconfig):
err_log_dir = None

def get_unique_err_log_dir(err_log_dir_data):
nonlocal err_log_dir
if err_log_dir is None:
Expand Down
2 changes: 0 additions & 2 deletions test/framework/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,6 @@ def test_list_software(self):
'homepage: https://easybuilders.github.io/easybuild',
'',
" * toy v0.0: gompi/2018a, system",
" * toy v0.0 (versionsuffix: '-buggy'): system",
" * toy v0.0 (versionsuffix: '-deps'): system",
" * toy v0.0 (versionsuffix: '-iter'): system",
" * toy v0.0 (versionsuffix: '-multiple'): system",
Expand All @@ -747,7 +746,6 @@ def test_list_software(self):
'version versionsuffix toolchain',
'======= ============= ===========================',
'``0.0`` ``gompi/2018a``, ``system``',
'``0.0`` ``-buggy`` ``system``',
'``0.0`` ``-deps`` ``system``',
'``0.0`` ``-iter`` ``system``',
'``0.0`` ``-multiple`` ``system``',
Expand Down
33 changes: 0 additions & 33 deletions test/framework/easyconfigs/test_ecs/t/toy/toy-0.0-buggy.eb

This file was deleted.

2 changes: 1 addition & 1 deletion test/framework/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,7 @@ def test_index_functions(self):
# test with specified path with and without trailing '/'s
for path in [test_ecs, test_ecs + '/', test_ecs + '//']:
index = ft.create_index(path)
self.assertEqual(len(index), 95)
self.assertEqual(len(index), 94)

expected = [
os.path.join('b', 'bzip2', 'bzip2-1.0.6-GCC-4.9.2.eb'),
Expand Down
18 changes: 15 additions & 3 deletions test/framework/toy_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,21 @@ def check_errorlog(self, output_regexs, outtxt, tmp_logpath, buildpath, errorlog
def test_toy_broken_compilation(self):
"""Test whether log files and the build directory are copied to a permanent location after a failed
compilation."""
with tempfile.TemporaryDirectory() as tmpdir, tempfile.TemporaryDirectory() as tmp_logdir:
broken_compilation_ec = os.path.join(os.path.dirname(__file__),
'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0-buggy.eb')
with tempfile.TemporaryDirectory() as tmpdir, \
tempfile.TemporaryDirectory() as tmp_logdir, \
tempfile.TemporaryDirectory() as tmp_easyconfig_dir:

base_ec = os.path.join(
os.path.dirname(__file__),
'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0.eb')

base_ec_txt = read_file(base_ec)
broken_compilation_ec_txt = re.sub(
r'toy-0\.0_fix-silly-typo-in-printf-statement\.patch',
r'toy-0.0_add-bug.patch',
base_ec_txt)
broken_compilation_ec = os.path.join(tmp_easyconfig_dir, 'toy-0.0-buggy.eb')
write_file(broken_compilation_ec, broken_compilation_ec_txt)

self.mock_stderr(True)
self.mock_stdout(True)
Expand Down

0 comments on commit b43bcf5

Please sign in to comment.