Skip to content

Commit

Permalink
fix test_github_merge_pr by using more recent commits
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Apr 14, 2023
1 parent 7c3ad91 commit 9eb5902
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions test/framework/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -4751,14 +4751,15 @@ def test_github_merge_pr(self):

expected_stdout = '\n'.join([
"Checking eligibility of easybuilders/easybuild-easyconfigs PR #4781 for merging...",
"* test suite passes: OK",
"* last test report is successful: OK",
"* no pending change requests: OK",
"* milestone is set: OK (3.3.1)",
"* mergeable state is clean: PR is already merged",
])
expected_stderr = '\n'.join([
"* targets some_branch branch: FAILED; found 'develop' => not eligible for merging!",
# since commit status for old PRs is no longer available, so test suite check fails
"* test suite passes: (status: None) => not eligible for merging!",
"* approved review: MISSING => not eligible for merging!",
'',
"WARNING: Review indicates this PR should not be merged (use -f/--force to do so anyway)",
Expand All @@ -4768,24 +4769,24 @@ def test_github_merge_pr(self):

# full eligible merged PR, default target branch
del args[-1]
args[1] = '4832'
args[1] = '17065'

stdout, stderr = self._run_mock_eb(args, do_build=True, raise_error=True, testing=False)

expected_stdout = '\n'.join([
"Checking eligibility of easybuilders/easybuild-easyconfigs PR #4832 for merging...",
"Checking eligibility of easybuilders/easybuild-easyconfigs PR #17065 for merging...",
"* targets develop branch: OK",
"* test suite passes: OK",
"* last test report is successful: OK",
"* no pending change requests: OK",
"* approved review: OK (by wpoely86)",
"* milestone is set: OK (3.3.1)",
"* approved review: OK (by SebastianAchilles)",
"* milestone is set: OK (4.7.1)",
"* mergeable state is clean: PR is already merged",
'',
"Review OK, merging pull request!",
'',
"[DRY RUN] Adding comment to easybuild-easyconfigs issue #4832: 'Going in, thanks @boegel!'",
"[DRY RUN] Merged easybuilders/easybuild-easyconfigs pull request #4832",
"[DRY RUN] Adding comment to easybuild-easyconfigs issue #17065: 'Going in, thanks @boegel!'",
"[DRY RUN] Merged easybuilders/easybuild-easyconfigs pull request #17065",
])
expected_stderr = ''
self.assertEqual(stderr.strip(), expected_stderr)
Expand All @@ -4794,20 +4795,20 @@ def test_github_merge_pr(self):
# --merge-pr also works on easyblocks (& framework) PRs
args = [
'--merge-pr',
'1206',
'2805',
'--pr-target-repo=easybuild-easyblocks',
'-D',
'--github-user=%s' % GITHUB_TEST_ACCOUNT,
]
stdout, stderr = self._run_mock_eb(args, do_build=True, raise_error=True, testing=False)
self.assertEqual(stderr.strip(), '')
expected_stdout = '\n'.join([
"Checking eligibility of easybuilders/easybuild-easyblocks PR #1206 for merging...",
"Checking eligibility of easybuilders/easybuild-easyblocks PR #2805 for merging...",
"* targets develop branch: OK",
"* test suite passes: OK",
"* no pending change requests: OK",
"* approved review: OK (by migueldiascosta)",
"* milestone is set: OK (3.3.1)",
"* approved review: OK (by ocaisa)",
"* milestone is set: OK (4.6.2)",
"* mergeable state is clean: PR is already merged",
'',
"Review OK, merging pull request!",
Expand Down

0 comments on commit 9eb5902

Please sign in to comment.