diff options
author | James E. Blair <jim@acmegating.com> | 2022-08-11 18:44:07 -0700 |
---|---|---|
committer | James E. Blair <jim@acmegating.com> | 2022-08-11 18:44:07 -0700 |
commit | 80a45b77b52a655b09153baef9b9ee64a8161255 (patch) | |
tree | 400a9fd88b5d53a20281e2bc430db28a1afde5a4 /tests | |
parent | d35b9f8c73df7fd84251d225f15f3cd22388690c (diff) | |
download | zuul-80a45b77b52a655b09153baef9b9ee64a8161255.tar.gz |
Add detail to "depends on a change that failed to merge"
The report message "This change depends on a change that failed to
merge" (and a similar change for circular dependency bundles) is
famously vague. To help users identify the actual problem, include
URLs for which change(s) caused the problem so that users may more
easily resolve the issue.
Change-Id: Id8b9f8cf2c108703e9209e30bdc9a3933f074652
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/test_circular_dependencies.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/unit/test_circular_dependencies.py b/tests/unit/test_circular_dependencies.py index 2223008d5..292941c13 100644 --- a/tests/unit/test_circular_dependencies.py +++ b/tests/unit/test_circular_dependencies.py @@ -13,6 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this software. If not, see <http://www.gnu.org/licenses/>. +import re import textwrap from zuul.model import PromoteEvent @@ -599,8 +600,23 @@ class TestGerritCircularDependencies(ZuulTestCase): self.assertIn("depends on a change that failed to merge", A.messages[-1]) + self.assertTrue(re.search(r'Change http://localhost:\d+/2 is needed', + A.messages[-1])) + self.assertFalse(re.search('Change .*? can not be merged', + A.messages[-1])) + self.assertIn("bundle that failed.", B.messages[-1]) + self.assertFalse(re.search('Change http://localhost:.*? is needed', + B.messages[-1])) + self.assertFalse(re.search('Change .*? can not be merged', + B.messages[-1])) + self.assertIn("bundle that failed.", C.messages[-1]) + self.assertFalse(re.search('Change http://localhost:.*? is needed', + C.messages[-1])) + self.assertFalse(re.search('Change .*? can not be merged', + C.messages[-1])) + self.assertEqual(A.data["status"], "NEW") self.assertEqual(B.data["status"], "NEW") self.assertEqual(C.data["status"], "NEW") @@ -2441,3 +2457,21 @@ class TestGithubCircularDependencies(ZuulTestCase): self.assertEqual(len(B.comments), 2) self.assertFalse(A.is_merged) self.assertFalse(B.is_merged) + + self.assertIn("part of a bundle that can not merge", + A.comments[-1]) + self.assertTrue( + re.search("Change https://github.com/gh/project/pull/1 " + "can not be merged", + A.comments[-1])) + self.assertFalse(re.search('Change .*? is needed', + A.comments[-1])) + + self.assertIn("part of a bundle that can not merge", + B.comments[-1]) + self.assertTrue( + re.search("Change https://github.com/gh/project/pull/1 " + "can not be merged", + B.comments[-1])) + self.assertFalse(re.search('Change .*? is needed', + B.comments[-1])) |