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
8 changes: 5 additions & 3 deletions easybuild/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def process_eb_args(eb_args, eb_go, cfg_settings, modtool, testing, init_session
# dry_run: print all easyconfigs and dependencies, and whether they are already built
elif dry_run_mode:
if options.missing_modules:
txt = missing_deps(easyconfigs, modtool)
txt = missing_deps(easyconfigs, modtool, terse=options.terse)
else:
txt = dry_run(easyconfigs, modtool, short=not options.dry_run)
print_msg(txt, log=_log, silent=testing, prefix=False)
Expand Down Expand Up @@ -684,7 +684,9 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None, pr
options.list_prs,
options.merge_pr,
options.review_pr,
options.terse,
# --missing-modules is processed by process_eb_args,
# so we can't exit just yet here if it's used in combination with --terse
options.terse and not options.missing_modules,
search_query,
]
if any(early_stop_options):
Expand Down Expand Up @@ -721,7 +723,7 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None, pr
# stop logging and cleanup tmp log file, unless one build failed (individual logs are located in eb_tmpdir)
stop_logging(logfile, logtostdout=options.logtostdout)
if do_cleanup:
cleanup(logfile, eb_tmpdir, testing, silent=False)
cleanup(logfile, eb_tmpdir, testing, silent=options.terse)


def prepare_main(args=None, logfile=None, testing=None):
Expand Down
1 change: 1 addition & 0 deletions easybuild/tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ def mk_full_default_path(name, prefix=DEFAULT_PREFIX):
'skip_test_cases',
'skip_test_step',
'sticky_bit',
'terse',
'trace',
'unit_testing_mode',
'upload_test_report',
Expand Down
5 changes: 3 additions & 2 deletions easybuild/tools/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,11 +966,12 @@ def load_index(path, ignore_dirs=None):
# check whether index is still valid
if valid_ts:
curr_ts = datetime.datetime.now()
terse = build_option('terse')
if curr_ts > valid_ts:
print_warning("Index for %s is no longer valid (too old), so ignoring it...", path)
print_warning("Index for %s is no longer valid (too old), so ignoring it...", path, silent=terse)
index = None
else:
print_msg("found valid index for %s, so using it...", path)
print_msg("found valid index for %s, so using it...", path, silent=terse)

return index or None

Expand Down
8 changes: 5 additions & 3 deletions easybuild/tools/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,18 @@ def dry_run(easyconfigs, modtool, short=False):
return '\n'.join(lines)


def missing_deps(easyconfigs, modtool):
def missing_deps(easyconfigs, modtool, terse=False):
"""
Determine subset of easyconfigs for which no module is installed yet.
"""
ordered_ecs = resolve_dependencies(easyconfigs, modtool, retain_all_deps=True, raise_error_missing_ecs=False)
missing = skip_available(ordered_ecs, modtool)

if missing:
if terse:
lines = [os.path.basename(x['ec'].path) for x in missing]
elif missing:
lines = ['', "%d out of %d required modules missing:" % (len(missing), len(ordered_ecs)), '']
for ec in [x['ec'] for x in missing]:
for ec in (x['ec'] for x in missing):
if ec.short_mod_name != ec.full_mod_name:
modname = '%s | %s' % (ec.mod_subdir, ec.short_mod_name)
else:
Expand Down
24 changes: 18 additions & 6 deletions test/framework/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1472,14 +1472,26 @@ def test_missing(self):
])

for opt in ['-M', '--missing-modules']:
self.mock_stderr(True)
self.mock_stdout(True)
self.eb_main(args + [opt], testing=False, raise_error=True)
stderr, stdout = self.get_stderr(), self.get_stdout()
self.mock_stderr(False)
self.mock_stdout(False)
with self.mocked_stdout_stderr():
self.eb_main(args + [opt], testing=False, raise_error=True)
stderr, stdout = self.get_stderr(), self.get_stdout()
self.assertFalse(stderr)
self.assertIn(expected, stdout)
# --terse
with self.mocked_stdout_stderr():
self.eb_main(args + ['-M', '--terse'], testing=False, raise_error=True)
stderr, stdout = self.get_stderr(), self.get_stdout()
self.assertFalse(stderr)
if mns == 'HierarchicalMNS':
expected = '\n'.join([
"GCC-4.6.3.eb",
"intel-2018a.eb",
"toy-0.0-deps.eb",
"gzip-1.4-GCC-4.6.3.eb",
])
else:
expected = 'gzip-1.4-GCC-4.6.3.eb'
self.assertEqual(stdout, expected + '\n')

def test_dry_run_short(self):
"""Test dry run (short format)."""
Expand Down