diff --git a/easybuild/tools/robot.py b/easybuild/tools/robot.py index 5189769929..70901c2413 100644 --- a/easybuild/tools/robot.py +++ b/easybuild/tools/robot.py @@ -242,7 +242,7 @@ def dry_run(easyconfigs, modtool, short=False): :param short: use short format for overview: use a variable for common prefixes """ lines = [] - if build_option('robot_path') is None: + if build_option('robot') is None: lines.append("Dry run: printing build status of easyconfigs") all_specs = easyconfigs else: diff --git a/test/framework/easyconfig.py b/test/framework/easyconfig.py index 49f40f978a..953f58574a 100644 --- a/test/framework/easyconfig.py +++ b/test/framework/easyconfig.py @@ -3628,6 +3628,7 @@ def test_hidden_toolchain(self): args = [ ec_file, '--dry-run', + '--robot', ] outtxt = self.eb_main(args, raise_error=True) self.assertTrue(re.search(r'module: GCC/\.4\.9\.2', outtxt)) diff --git a/test/framework/options.py b/test/framework/options.py index 9f672bbc36..7c7d950c88 100644 --- a/test/framework/options.py +++ b/test/framework/options.py @@ -1532,12 +1532,15 @@ def test_copy_ec_from_commit(self): def test_dry_run(self): """Test dry run (long format).""" + + # first test with --robot fd, dummylogfn = tempfile.mkstemp(prefix='easybuild-dummy', suffix='.log') os.close(fd) args = [ 'gzip-1.4-GCC-4.6.3.eb', - '--dry-run', # implies enabling dependency resolution + '--dry-run', + '--robot', # implies enabling dependency resolution '--unittest-file=%s' % self.logfile, ] self.eb_main(args, logfile=dummylogfn) @@ -1553,6 +1556,24 @@ def test_dry_run(self): regex = re.compile(r" \* \[%s\] \S+%s \(module: %s\)" % (mark, ec, mod), re.M) self.assertTrue(regex.search(logtxt), "Found match for pattern %s in '%s'" % (regex.pattern, logtxt)) + # next test without --robot + fd, dummylogfn = tempfile.mkstemp(prefix='easybuild-dummy', suffix='.log') + os.close(fd) + + args = [ + 'gzip-1.4-GCC-4.6.3.eb', + '--dry-run', + '--unittest-file=%s' % self.logfile, + ] + self.eb_main(args, logfile=dummylogfn) + logtxt = read_file(self.logfile) + + info_msg = r"Dry run: printing build status of easyconfigs" + self.assertTrue(re.search(info_msg, logtxt, re.M), "Info message dry running in '%s'" % logtxt) + ec, mod, mark = ("gzip-1.4-GCC-4.6.3.eb", "gzip/1.4-GCC-4.6.3", ' ') + regex = re.compile(r" \* \[%s\] \S+%s \(module: %s\)" % (mark, ec, mod), re.M) + self.assertTrue(regex.search(logtxt), "Found match for pattern %s in '%s'" % (regex.pattern, logtxt)) + def test_missing(self): """Test use of --missing/-M.""" @@ -1705,6 +1726,7 @@ def test_try_toolchain_mapping(self): gzip_ec, '--try-toolchain=iccifort,2016.1.150-GCC-4.9.3-2.25', '--dry-run', + '--robot', ] # by default, toolchain mapping is enabled @@ -1759,6 +1781,7 @@ def test_try_update_deps(self): '--try-toolchain-version=6.4.0-2.28', '--try-update-deps', '-D', + '--robot', ] self.assertErrorRegex(EasyBuildError, "Experimental functionality", self.eb_main, args, raise_error=True) @@ -1840,6 +1863,7 @@ def test_dry_run_hierarchical(self): 'gzip-1.5-foss-2018a.eb', 'OpenMPI-2.1.2-GCC-6.4.0-2.28.eb', '--dry-run', + '--robot', '--unittest-file=%s' % self.logfile, '--module-naming-scheme=HierarchicalMNS', '--ignore-osdeps', @@ -1880,6 +1904,7 @@ def test_dry_run_categorized(self): 'gzip-1.5-foss-2018a.eb', 'OpenMPI-2.1.2-GCC-6.4.0-2.28.eb', '--dry-run', + '--robot', '--unittest-file=%s' % self.logfile, '--module-naming-scheme=CategorizedHMNS', '--ignore-osdeps', @@ -2187,6 +2212,7 @@ def test_from_commit(self): args = [ '--from-commit=%s' % test_commit, '--dry-run', + '--robot', '--tmpdir=%s' % tmpdir, '--include-easyblocks=' + os.path.join(self.test_prefix, 'easyblocks', '*.py'), ] @@ -3018,6 +3044,7 @@ def test_hide_toolchains(self): args = [ ec_file, '--dry-run', + '--robot', '--hide-toolchains=GCC', ] outtxt = self.eb_main(args) @@ -4248,6 +4275,7 @@ def test_minimal_toolchains(self): '--minimal-toolchains', '--module-naming-scheme=HierarchicalMNS', '--dry-run', + '--robot', ] self.mock_stdout(True) self.eb_main(args, do_build=True, raise_error=True, testing=False)