Skip to content

Commit 7802570

Browse files
committed
add test for opening an easyblock PR via --new-pr
1 parent 4c4a6a6 commit 7802570

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/framework/options.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4568,6 +4568,37 @@ def test_github_new_pr_dependencies(self):
45684568

45694569
self._assert_regexs(regexs, txt)
45704570

4571+
def test_new_pr_easyblock(self):
4572+
"""
4573+
Test using --new-pr to open an easyblocks PR
4574+
"""
4575+
4576+
if self.github_token is None:
4577+
print("Skipping test_new_pr_easyblock, no GitHub token available?")
4578+
return
4579+
4580+
topdir = os.path.dirname(os.path.abspath(__file__))
4581+
toy_eb = os.path.join(topdir, 'sandbox', 'easybuild', 'easyblocks', 't', 'toy.py')
4582+
self.assertTrue(os.path.exists(toy_eb))
4583+
4584+
args = [
4585+
'--github-user=%s' % GITHUB_TEST_ACCOUNT,
4586+
'--new-pr',
4587+
toy_eb,
4588+
'-D',
4589+
]
4590+
txt, _ = self._run_mock_eb(args, do_build=True, raise_error=True, testing=False)
4591+
4592+
patterns = [
4593+
r'target: easybuilders/easybuild-easyblocks:develop',
4594+
r'from: easybuild_test/easybuild-easyblocks:[0-9]+_new_pr_toy',
4595+
r'title: "new easyblock for toy"',
4596+
r'easybuild/easyblocks/t/toy.py',
4597+
]
4598+
for pattern in patterns:
4599+
regex = re.compile(pattern)
4600+
self.assertTrue(regex.search(txt), "Pattern '%s' should be found in: %s" % (regex.pattern, txt))
4601+
45714602
def test_github_merge_pr(self):
45724603
"""
45734604
Test use of --merge-pr (dry run)"""

0 commit comments

Comments
 (0)