Title: [275941] trunk/Tools
Revision
275941
Author
aakash_j...@apple.com
Date
2021-04-14 03:18:00 -0700 (Wed, 14 Apr 2021)

Log Message

Commit queue isn't skipping builds and test on revert patches
https://bugs.webkit.org/show_bug.cgi?id=224477

Reviewed by Jonathan Bedard.

* CISupport/ews-build/steps.py:
(BugzillaMixin): Changed preamble to lower-case to match with new logic.
* CISupport/ews-build/steps_unittest.py: Added unit-tests.

Modified Paths

Diff

Modified: trunk/Tools/CISupport/ews-build/steps.py (275940 => 275941)


--- trunk/Tools/CISupport/ews-build/steps.py	2021-04-14 10:03:10 UTC (rev 275940)
+++ trunk/Tools/CISupport/ews-build/steps.py	2021-04-14 10:18:00 UTC (rev 275941)
@@ -528,7 +528,7 @@
     addURLs = False
     bug_open_statuses = ['UNCONFIRMED', 'NEW', 'ASSIGNED', 'REOPENED']
     bug_closed_statuses = ['RESOLVED', 'VERIFIED', 'CLOSED']
-    revert_preamble = 'REVERT of r'
+    revert_preamble = 'revert of r'
     fast_cq_preamble = '[fast-cq]'
 
     @defer.inlineCallbacks

Modified: trunk/Tools/CISupport/ews-build/steps_unittest.py (275940 => 275941)


--- trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-04-14 10:03:10 UTC (rev 275940)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-04-14 10:18:00 UTC (rev 275941)
@@ -4063,6 +4063,17 @@
     def tearDown(self):
         return self.tearDownBuildStep()
 
+    def get_patch(self, title='Patch', obsolete=0):
+        return json.loads('''{{"bug_id": 224460,
+                     "creator":"aakash_j...@apple.com",
+                     "data": "patch-contents",
+                     "file_name":"bug-224460-20210412192105.patch",
+                     "flags": [{{"creation_date" : "2021-04-12T23:21:06Z", "id": 445872, "modification_date": "2021-04-12T23:55:36Z", "name": "review", "setter": "a...@webkit.org", "status": "+", "type_id": 1}}],
+                     "id": 425806,
+                     "is_obsolete": {},
+                     "is_patch": 1,
+                     "summary": "{}"}}'''.format(obsolete, title))
+
     def test_skipped(self):
         self.setupStep(ValidatePatch())
         self.setProperty('patch_id', '1234')
@@ -4071,7 +4082,43 @@
         self.expectOutcome(result=SKIPPED, state_string='Validated patch (skipped)')
         return self.runStep()
 
+    def test_success(self):
+        self.setupStep(ValidatePatch(verifyBugClosed=False))
+        ValidatePatch.get_patch_json = lambda x, patch_id: self.get_patch()
+        self.setProperty('patch_id', '425806')
+        self.expectOutcome(result=SUCCESS, state_string='Validated patch')
+        rc = self.runStep()
+        self.assertEqual(self.getProperty('fast_commit_queue'), None, 'fast_commit_queue is unexpectedly set')
+        return rc
 
+    def test_obsolete_patch(self):
+        self.setupStep(ValidatePatch(verifyBugClosed=False))
+        ValidatePatch.get_patch_json = lambda x, patch_id: self.get_patch(obsolete=1)
+        self.setProperty('patch_id', '425806')
+        self.expectOutcome(result=FAILURE, state_string='Patch 425806 is obsolete')
+        rc = self.runStep()
+        self.assertEqual(self.getProperty('fast_commit_queue'), None, 'fast_commit_queue is unexpectedly set')
+        return rc
+
+    def test_revert_patch_trigger_fast_cq_mode(self):
+        self.setupStep(ValidatePatch(verifyBugClosed=False))
+        ValidatePatch.get_patch_json = lambda x, patch_id: self.get_patch(title='REVERT OF r123456')
+        self.setProperty('patch_id', '425806')
+        self.expectOutcome(result=SUCCESS, state_string='Validated patch')
+        rc = self.runStep()
+        self.assertEqual(self.getProperty('fast_commit_queue'), True, 'fast_commit_queue is not set')
+        return rc
+
+    def test_fast_cq_patch_trigger_fast_cq_mode(self):
+        self.setupStep(ValidatePatch(verifyBugClosed=False))
+        ValidatePatch.get_patch_json = lambda x, patch_id: self.get_patch(title='[fast-cq] Patch')
+        self.setProperty('patch_id', '425806')
+        self.expectOutcome(result=SUCCESS, state_string='Validated patch')
+        rc = self.runStep()
+        self.assertEqual(self.getProperty('fast_commit_queue'), True, 'fast_commit_queue is not set')
+        return rc
+
+
 class TestValidateCommiterAndReviewer(BuildStepMixinAdditions, unittest.TestCase):
     def setUp(self):
         self.longMessage = True

Modified: trunk/Tools/ChangeLog (275940 => 275941)


--- trunk/Tools/ChangeLog	2021-04-14 10:03:10 UTC (rev 275940)
+++ trunk/Tools/ChangeLog	2021-04-14 10:18:00 UTC (rev 275941)
@@ -1,3 +1,14 @@
+2021-04-14  Aakash Jain  <aakash_j...@apple.com>
+
+        Commit queue isn't skipping builds and test on revert patches
+        https://bugs.webkit.org/show_bug.cgi?id=224477
+
+        Reviewed by Jonathan Bedard.
+
+        * CISupport/ews-build/steps.py:
+        (BugzillaMixin): Changed preamble to lower-case to match with new logic.
+        * CISupport/ews-build/steps_unittest.py: Added unit-tests.
+
 2021-04-14  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK4] Use a while loop in PlatformWebView::dismissAllPopupMenus()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to