Skip to content

Commit

Permalink
fix --from-pr tests w.r.t. changed behaviour, make path matching less…
Browse files Browse the repository at this point in the history
… strict to deal with symlinked tmpdir
  • Loading branch information
boegel committed Aug 9, 2016
1 parent 246465b commit 6c76047
Showing 1 changed file with 9 additions and 8 deletions.
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 6c76047

Please sign in to comment.