Add support for github enterprise
GitHub enterprise just requires setting a git_host to something other
than the default of 'github.com'. If this host is set to something else,
perform an enterprise_login() instead of a login(). All other activity
appears to be the same.
A more complete change would be allowing clone/push using the API key
instead of the ssh key, which would reduce the amount of credentials one
must manage on the zuul host.
Change-Id: I4db7677cf5ff0bf798e20dcbc327e1dd874a2e7e
diff --git a/tests/unit/test_github_driver.py b/tests/unit/test_github_driver.py
index e8abf79..a1a05e0 100644
--- a/tests/unit/test_github_driver.py
+++ b/tests/unit/test_github_driver.py
@@ -230,6 +230,12 @@
url = self.fake_github_ssh.real_getGitUrl('org/project')
self.assertEqual('ssh://git@github.com/org/project.git', url)
+ @simple_layout('layouts/basic-github.yaml', driver='github')
+ def test_git_enterprise_url(self):
+ """Test that git_url option gives git url with proper host"""
+ url = self.fake_github_ent.real_getGitUrl('org/project')
+ self.assertEqual('ssh://git@github.enterprise.io/org/project.git', url)
+
@simple_layout('layouts/reporting-github.yaml', driver='github')
def test_reporting(self):
# pipeline reports pull status both on start and success