Simplify test output strings for new Gerrit

In adapting the integration tests to output from new Gerrit
versions, we observed possible nondeterministic ordering or content
in some of the fields. We don't need to be nearly so specific in the
strings we match anyway, so simplify them for robustness against
variable output from the service and improved future flexibility.

Change-Id: Icbd70d9c8c9da3637cfa5722a636d140597fe623
This commit is contained in:
Jeremy Stanley 2023-03-08 20:42:38 +00:00
parent 0ecdd60a0a
commit f02b41df74

View File

@ -225,7 +225,7 @@ class GitReviewTestCase(tests.BaseGitReviewTestCase):
review_res = self._run_git_review(confirm=True)
self.assertIn("Type 'yes' to confirm", review_res)
self.assertIn("Processing changes: new: 2", review_res)
self.assertIn("new: 2", review_res)
# abandon changes sent to the Gerrit
head = self._run_git('rev-parse', 'HEAD')
@ -239,7 +239,7 @@ 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: refs: 1, new: 2", review_res)
self.assertIn("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)
@ -258,7 +258,7 @@ class GitReviewTestCase(tests.BaseGitReviewTestCase):
review_res = self._run_git_review('--reviewers', 'reviewer1',
'reviewer2')
self.assertIn("Processing changes: new: 1", review_res)
self.assertIn("new: 1", review_res)
# verify both reviewers are on patch set
head = self._run_git('rev-parse', 'HEAD')