Include PR title in change message

Gerrit includes the whole commit message (subject + body). For a GitHub
PR only the body was included in the change message.

This patch adds also the PR title to the change message so we have a
similar behavior for GitHub.

Change-Id: I662e6898cb52b73e0341512b7bffe7f858552dda
This commit is contained in:
Simon Westphahl
2019-01-16 13:29:56 +01:00
committed by Tobias Henkel
parent a1283f403f
commit 47d55215aa
2 changed files with 11 additions and 2 deletions

View File

@@ -36,7 +36,9 @@ class TestGithubDriver(ZuulTestCase):
def test_pull_event(self):
self.executor_server.hold_jobs_in_build = True
A = self.fake_github.openFakePullRequest('org/project', 'master', 'A')
body = "This is the\nPR body."
A = self.fake_github.openFakePullRequest('org/project', 'master', 'A',
body=body)
self.fake_github.emitEvent(A.getPullRequestOpenedEvent())
self.waitUntilSettled()
@@ -56,6 +58,7 @@ class TestGithubDriver(ZuulTestCase):
self.assertEqual('master', zuulvars['branch'])
self.assertEquals('https://github.com/org/project/pull/1',
zuulvars['items'][0]['change_url'])
self.assertEqual(zuulvars["message"], "A\n\n{}".format(body))
self.assertEqual(1, len(A.comments))
self.assertThat(
A.comments[0],