Skip to content

Commit

Permalink
Merge pull request #33 from boegel/fix_broken_from_pr
Browse files Browse the repository at this point in the history
fix --from-pr tests, append to robot search path
  • Loading branch information
Caylo authored Aug 9, 2016
2 parents 928fdf8 + 6c76047 commit 8727fba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions easybuild/tools/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def det_robot_path(robot_paths_option, tweaked_ecs_path, pr_path, auto_robot=Fal
robot_path.insert(0, tweaked_ecs_path)
_log.info("Prepended list of robot search paths with %s: %s" % (tweaked_ecs_path, robot_path))
if pr_path is not None:
robot_path.insert(0, pr_path)
_log.info("Prepended list of robot search paths with %s: %s" % (pr_path, robot_path))
robot_path.append(pr_path)
_log.info("Appended list of robot search paths with %s: %s" % (pr_path, robot_path))

return robot_path

Expand Down
17 changes: 9 additions & 8 deletions test/framework/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,15 +895,16 @@ def test_from_pr(self):
]
for path_prefix, module in modules:
ec_fn = "%s.eb" % '-'.join(module.split('/'))
regex = re.compile(r"^ \* \[.\] %s.*%s \(module: %s\)$" % (path_prefix, ec_fn, module), re.M)
path = '.*%s' % os.path.dirname(path_prefix)
regex = re.compile(r"^ \* \[.\] %s.*%s \(module: %s\)$" % (path, ec_fn, module), re.M)
self.assertTrue(regex.search(outtxt), "Found pattern %s in %s" % (regex.pattern, outtxt))

# make sure that *only* these modules are listed, no others
regex = re.compile(r"^ \* \[.\] .*/(?P<filepath>.*) \(module: (?P<module>.*)\)$", re.M)
self.assertTrue(sorted(regex.findall(outtxt)), sorted(modules))

pr_tmpdir = os.path.join(tmpdir, 'eb-\S{6}', 'files_pr1239')
regex = re.compile("Prepended list of robot search paths with %s:" % pr_tmpdir, re.M)
regex = re.compile("Appended list of robot search paths with %s:" % pr_tmpdir, re.M)
self.assertTrue(regex.search(outtxt), "Found pattern %s in %s" % (regex.pattern, outtxt))
except URLError, err:
print "Ignoring URLError '%s' in test_from_pr" % err
Expand Down Expand Up @@ -945,12 +946,12 @@ def test_from_pr_listed_ecs(self):
outtxt = self.eb_main(args, logfile=dummylogfn, raise_error=True)
modules = [
(test_ecs_path, 'toy/0.0'), # not included in PR
(tmpdir, 'GCC/4.9.2'), # not included in PR
(tmpdir, 'hwloc/1.10.0-GCC-4.9.2'),
(tmpdir, 'numactl/2.0.10-GCC-4.9.2'),
(tmpdir, 'OpenMPI/1.8.4-GCC-4.9.2'),
(tmpdir, 'gompi/2015a'),
(test_ecs_path, 'GCC/4.6.3'), # not included in PR
(test_ecs_path, 'GCC/4.9.2'), # not included in PR, available locally
('.*%s' % os.path.dirname(tmpdir), 'hwloc/1.10.0-GCC-4.9.2'),
('.*%s' % os.path.dirname(tmpdir), 'numactl/2.0.10-GCC-4.9.2'),
('.*%s' % os.path.dirname(tmpdir), 'OpenMPI/1.8.4-GCC-4.9.2'),
('.*%s' % os.path.dirname(tmpdir), 'gompi/2015a'),
(test_ecs_path, 'GCC/4.6.3'), # not included in PR, available locally
]
for path_prefix, module in modules:
ec_fn = "%s.eb" % '-'.join(module.split('/'))
Expand Down

0 comments on commit 8727fba

Please sign in to comment.