-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PTFE-401 add option to check integration branch
- Loading branch information
Showing
11 changed files
with
124 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% extends "message.md" %} | ||
|
||
{% block title -%} | ||
Request integration branches | ||
{% endblock %} | ||
|
||
{% block message %} | ||
Waiting for integration branch creation to be requested by the user. | ||
|
||
To request integration branches, please comment on this pull request with the following command: | ||
|
||
``` | ||
/create_integration_branches | ||
``` | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1159,6 +1159,56 @@ def test_comments_without_integration_pull_requests(self): | |
self.assertIn('Hello %s' % self.args.contributor_username, | ||
self.get_last_pr_comment(pr)) | ||
|
||
|
||
def test_request_integration_branch_creation(self): | ||
"""Test comments to request integration branches creation. | ||
1. Create a PR and ensure the proper message is sent regarding | ||
the creation of integration branches | ||
2. Request the creation of integration branches and ensure the | ||
branches are created. | ||
3. Ensure that no other comment has been created. | ||
""" | ||
settings = """ | ||
repository_owner: {owner} | ||
repository_slug: {slug} | ||
repository_host: {host} | ||
robot: {robot} | ||
robot_email: [email protected] | ||
pull_request_base_url: https://bitbucket.org/{owner}/{slug}/bar/pull-requests/{{pr_id}} | ||
commit_base_url: https://bitbucket.org/{owner}/{slug}/commits/{{commit_id}} | ||
build_key: pre-merge | ||
required_leader_approvals: 0 | ||
required_peer_approvals: 1 | ||
always_create_integration_branches: false | ||
admins: | ||
- {admin} | ||
""" # noqa | ||
options = self.bypass_all_but(['bypass_build_status']) | ||
pr = self.create_pr('feature/TEST-0069', 'development/4.3') | ||
with self.assertRaises(exns.RequestIntegrationBranches) as raised: | ||
self.handle( | ||
pr.id, settings=settings, options=options, backtrace=True) | ||
self.assertEqual(len(list(pr.get_comments())), 2) | ||
self.assertIn('Request integration branches', self.get_last_pr_comment(pr)) | ||
self.assertIn('/create_integration_branches', self.get_last_pr_comment(pr)) | ||
|
||
|
||
comment = pr.add_comment('/create_integration_branches') | ||
with self.assertRaises(exns.BuildNotStarted) as raised: | ||
self.handle( | ||
pr.id, settings=settings, options=options, backtrace=True) | ||
self.assertEqual(len(list(pr.get_comments())), 4) | ||
self.assertIn('Integration data created', self.get_last_pr_comment(pr)) | ||
self.assertIn('create_integration_branches', self.get_last_pr_comment(pr)) | ||
|
||
options = self.bypass_all | ||
with self.assertRaises(exns.SuccessMessage) as raised: | ||
self.handle( | ||
pr.id, settings=settings, options=options, backtrace=True) | ||
|
||
|
||
def test_comments_for_manual_integration_pr_creation(self): | ||
"""Test comments when integration data is created. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters