Merge "Upgrade testing to Gerrit 3.4.4"

This commit is contained in:
Zuul 2023-03-08 00:38:28 +00:00 committed by Gerrit Code Review
commit 0ecdd60a0a
5 changed files with 13 additions and 11 deletions

View File

@ -2,4 +2,4 @@
# install and tests; see http://docs.opendev.org/opendev/bindep/ for additional
# information.
openjdk-8-jdk [test]
openjdk-11-jdk [test]

View File

@ -37,10 +37,10 @@ else:
urlparse = urllib.parse.urlparse
WAR_URL = 'https://gerrit-releases.storage.googleapis.com/gerrit-2.13.14.war'
WAR_URL = 'https://gerrit-releases.storage.googleapis.com/gerrit-3.4.4.war'
# Update GOLDEN_SITE_VER for every change altering golden site, including
# WAR_URL changes. Set new value to something unique (just +1 it for example)
GOLDEN_SITE_VER = '5'
GOLDEN_SITE_VER = '6'
# NOTE(yorik-sar): This function needs to be a perfect hash function for
@ -225,7 +225,7 @@ class BaseGitReviewTestCase(testtools.TestCase, GerritHelpers):
pub_key = pub_key_fd.read().decode().strip()
resp = requests.post(
'http://%s:%s/a/accounts/self/sshkeys' % (http_addr, http_port),
auth=requests.auth.HTTPDigestAuth('admin', 'secret'),
auth=requests.auth.HTTPBasicAuth('admin', 'secret'),
headers={'Content-Type': 'text/plain'},
data=pub_key)
if resp.status_code != 201:

View File

@ -65,7 +65,9 @@ class GitReviewTestCase(tests.BaseGitReviewTestCase):
"""Test git-review on the just cloned repository."""
self._simple_change('test file modified', 'test commit message')
self.assertNotIn('Change-Id:', self._run_git('log', '-1'))
self.assertIn('remote: New Changes:', self._run_git_review())
gr = self._run_git_review()
self.assertIn('remote: SUCCESS', gr)
self.assertIn('test commit message [NEW]', gr)
self.assertIn('Change-Id:', self._run_git('log', '-1'))
def test_git_review_s(self):
@ -237,7 +239,10 @@ class GitReviewTestCase(tests.BaseGitReviewTestCase):
self._simple_change('test file modified 4th time',
'test commit message 4')
review_res = self._run_git_review('-y')
self.assertIn("Processing changes: new: 2", review_res)
self.assertIn("Processing changes: refs: 1, new: 2", review_res)
self.assertIn("remote: SUCCESS", review_res)
self.assertIn("test commit message 3 [NEW]", review_res)
self.assertIn("test commit message 4 [NEW]", review_res)
def test_git_review_re(self):
"""Test git-review adding reviewers to changes."""

View File

@ -31,6 +31,8 @@ GERRIT_CONF_TMPL = """
listenAddress = %s:%s
[httpd]
listenUrl = http://%s:%s/
[sendemail]
enable = false
"""

View File

@ -1,11 +1,6 @@
[tox]
envlist = linters,docs,py3
ignore_basepython_conflict = true
# We skipsdist to force test-requirements and specifically pbr
# to be installed prior to installing git-review. This ensures that
# easy_install doesn't try to talk to pypi.org for pbr which fails
# on older python due to a lack of SNI support.
skipsdist = true
[testenv]
basepython = python3