Skip to content

Commit a46d9c9

Browse files
committed
Fix test
There is no error raised for dry-run anymore so check the output. This is due to a change in #4704 that disables resolving dependencies for --dry-run without --robot
1 parent 256c6a0 commit a46d9c9

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

test/framework/options.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3480,13 +3480,24 @@ def test_robot(self):
34803480
't/toy/toy-0.0-deps.eb',
34813481
'g/gzip/gzip-1.4-GCC-4.6.3.eb',
34823482
]
3483+
re_template = r'^\s\*\s\[[xF ]\]\s%s'
34833484
for ecfile in ecfiles:
3484-
ec_regex = re.compile(r'^\s\*\s\[[xF ]\]\s%s' % os.path.join(test_ecs_path, ecfile), re.M)
3485-
self.assertTrue(ec_regex.search(outtxt), "Pattern %s found in %s" % (ec_regex.pattern, outtxt))
3485+
ec_regex = re.compile(re_template % os.path.join(test_ecs_path, ecfile), re.M)
3486+
self.assertRegex(outtxt, ec_regex)
34863487

34873488
# Check for disabling --robot
34883489
args.append('--disable-robot')
3489-
self.assertErrorRegex(EasyBuildError, 'Missing dependencies', self.eb_main, args, raise_error=True)
3490+
# Enabled on cmdline before and via option, but should be disabled
3491+
os.environ['EASYBUILD_ROBOT'] = self.test_prefix
3492+
with self.mocked_stdout_stderr():
3493+
outtxt = self.eb_main(args, raise_error=True)
3494+
for ecfile in ecfiles:
3495+
ec_regex = re.compile(re_template % os.path.join(test_ecs_path, ecfile), re.M)
3496+
# Only the EC passed would be build but not the dependencies
3497+
if os.path.basename(ecfile) == os.path.basename(eb_file):
3498+
self.assertRegex(outtxt, ec_regex)
3499+
else:
3500+
self.assertNotRegex(outtxt, ec_regex)
34903501

34913502
def test_robot_path_check(self):
34923503
"""Test path check for --robot"""

0 commit comments

Comments
 (0)