Title: [288811] trunk/Tools/CISupport/ews-build
Revision
288811
Author
aakash_j...@apple.com
Date
2022-01-31 05:29:25 -0800 (Mon, 31 Jan 2022)

Log Message

[ews] Cleanup code by removing patchFailedToBuild and patchFailedTests properties
https://bugs.webkit.org/show_bug.cgi?id=235860

Reviewed by Ryan Haddad.

Cleanup code by removing patchFailedToBuild and patchFailedTests properties. Those were added in very early days of ews bringup, when corresponding steps (e.g.: UnApplyPatchIfRequired) were listed statically in factories.py. Later on we started invoking steps dynamically using addStepsAfterCurrentStep and UnApplyPatchIfRequired is no longer called in factories.py. We can just remove all these patchFailedToBuild and patchFailedTests properties logic.

Also rename UnApplyPatchIfRequired to UnApplyPatch since this step is run only when it is required

* Tools/CISupport/ews-build/steps.py:
(UnApplyPatchIfRequired):
(CompileWebKit.evaluateCommand):
(RunJavaScriptCoreTests.evaluateCommand):
(ReRunWebKitTests.evaluateCommand):
(RunWebKitTestsRedTree.evaluateCommand):
(RunWebKitTestsRepeatFailuresRedTree.evaluateCommand):
(ReRunAPITests.evaluateCommand):
(UnApplyPatchIfRequired.doStepIf): Deleted.
(UnApplyPatchIfRequired.hideStepIf): Deleted.
(CompileWebKitWithoutPatch.doStepIf): Deleted.
(CompileWebKitWithoutPatch.hideStepIf): Deleted.
* Tools/CISupport/ews-build/steps_unittest.py: Updated unit-tests.

Canonical link: https://commits.webkit.org/246587@main

Modified Paths

Diff

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


--- trunk/Tools/CISupport/ews-build/steps.py	2022-01-31 12:46:42 UTC (rev 288810)
+++ trunk/Tools/CISupport/ews-build/steps.py	2022-01-31 13:29:25 UTC (rev 288811)
@@ -1458,17 +1458,11 @@
         return CURRENT_HOSTNAME == EWS_BUILD_HOSTNAME
 
 
-class UnApplyPatchIfRequired(CleanWorkingDirectory):
+class UnApplyPatch(CleanWorkingDirectory):
     name = 'unapply-patch'
     descriptionDone = ['Unapplied patch']
 
-    def doStepIf(self, step):
-        return self.getProperty('patchFailedToBuild') or self.getProperty('patchFailedTests')
 
-    def hideStepIf(self, results, step):
-        return not self.doStepIf(step)
-
-
 class Trigger(trigger.Trigger):
     def __init__(self, schedulerNames, include_revision=True, triggers=None, patch=True, pull_request=False, **kwargs):
         self.include_revision = include_revision
@@ -1926,8 +1920,7 @@
 
     def evaluateCommand(self, cmd):
         if cmd.didFail():
-            self.setProperty('patchFailedToBuild', True)
-            steps_to_add = [UnApplyPatchIfRequired(), ValidateChange(verifyBugClosed=False, addURLs=False)]
+            steps_to_add = [UnApplyPatch(), ValidateChange(verifyBugClosed=False, addURLs=False)]
             platform = self.getProperty('platform')
             if platform == 'wpe':
                 steps_to_add.append(InstallWpeDependencies())
@@ -1972,12 +1965,6 @@
         self.retry_build_on_failure = retry_build_on_failure
         super(CompileWebKitWithoutPatch, self).__init__(**kwargs)
 
-    def doStepIf(self, step):
-        return self.getProperty('patchFailedToBuild') or self.getProperty('patchFailedTests')
-
-    def hideStepIf(self, results, step):
-        return not self.doStepIf(step)
-
     def evaluateCommand(self, cmd):
         rc = shell.Compile.evaluateCommand(self, cmd)
         if rc == FAILURE and self.retry_build_on_failure:
@@ -2209,8 +2196,7 @@
             self.build.results = SUCCESS
             self.build.buildFinished([message], SUCCESS)
         else:
-            self.setProperty('patchFailedTests', True)
-            self.build.addStepsAfterCurrentStep([UnApplyPatchIfRequired(),
+            self.build.addStepsAfterCurrentStep([UnApplyPatch(),
                                                 ValidateChange(verifyBugClosed=False, addURLs=False),
                                                 CompileJSCWithoutPatch(),
                                                 ValidateChange(verifyBugClosed=False, addURLs=False),
@@ -2726,11 +2712,10 @@
                     self.send_email_for_flaky_failure(flaky_failure)
             self.setProperty('build_summary', message)
         else:
-            self.setProperty('patchFailedTests', True)
             self.build.addStepsAfterCurrentStep([ArchiveTestResults(),
                                                 UploadTestResults(identifier='rerun'),
                                                 ExtractTestResults(identifier='rerun'),
-                                                UnApplyPatchIfRequired(),
+                                                UnApplyPatch(),
                                                 ValidateChange(verifyBugClosed=False, addURLs=False),
                                                 CompileWebKitWithoutPatch(retry_build_on_failure=True),
                                                 ValidateChange(verifyBugClosed=False, addURLs=False),
@@ -3075,12 +3060,11 @@
             # We have a failure return code but not a list of failed or flaky tests, so we can't run the repeat steps.
             # If we are on the last retry then run the whole layout tests without patch.
             # If not, then go to analyze-layout-tests-results where we will retry everything hoping this was a random failure.
-            self.setProperty('patchFailedTests', True)
             retry_count = int(self.getProperty('retry_count', 0))
             if retry_count < AnalyzeLayoutTestsResultsRedTree.MAX_RETRY:
                 next_steps.append(AnalyzeLayoutTestsResultsRedTree())
             else:
-                next_steps.extend([UnApplyPatchIfRequired(), CompileWebKitWithoutPatch(retry_build_on_failure=True), ValidateChange(verifyBugClosed=False, addURLs=False), RunWebKitTestsWithoutPatchRedTree()])
+                next_steps.extend([UnApplyPatch(), CompileWebKitWithoutPatch(retry_build_on_failure=True), ValidateChange(verifyBugClosed=False, addURLs=False), RunWebKitTestsWithoutPatchRedTree()])
         if next_steps:
             self.build.addStepsAfterCurrentStep(next_steps)
         return rc
@@ -3109,8 +3093,7 @@
         self.setProperty('with_patch_repeat_failures_retcode', rc)
         next_steps = [ArchiveTestResults(), UploadTestResults(identifier='repeat-failures'), ExtractTestResults(identifier='repeat-failures')]
         if with_patch_repeat_failures_results_nonflaky_failures or with_patch_repeat_failures_timedout:
-            self.setProperty('patchFailedTests', True)
-            next_steps.extend([ValidateChange(verifyBugClosed=False, addURLs=False), KillOldProcesses(), UnApplyPatchIfRequired(), CompileWebKitWithoutPatch(retry_build_on_failure=True),
+            next_steps.extend([ValidateChange(verifyBugClosed=False, addURLs=False), KillOldProcesses(), UnApplyPatch(), CompileWebKitWithoutPatch(retry_build_on_failure=True),
                                ValidateChange(verifyBugClosed=False, addURLs=False), RunWebKitTestsRepeatFailuresWithoutPatchRedTree()])
         else:
             next_steps.append(AnalyzeLayoutTestsResultsRedTree())
@@ -3529,8 +3512,7 @@
             self.build.results = SUCCESS
             self.build.buildFinished([message], SUCCESS)
         else:
-            self.setProperty('patchFailedTests', True)
-            steps_to_add = [UnApplyPatchIfRequired(), ValidateChange(verifyBugClosed=False, addURLs=False)]
+            steps_to_add = [UnApplyPatch(), ValidateChange(verifyBugClosed=False, addURLs=False)]
             platform = self.getProperty('platform')
             if platform == 'wpe':
                 steps_to_add.append(InstallWpeDependencies())

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


--- trunk/Tools/CISupport/ews-build/steps_unittest.py	2022-01-31 12:46:42 UTC (rev 288810)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py	2022-01-31 13:29:25 UTC (rev 288811)
@@ -55,7 +55,7 @@
                    RunWebKitPyPython3Tests, RunWebKitTests, RunWebKitTestsInStressMode, RunWebKitTestsInStressGuardmallocMode,
                    RunWebKitTestsWithoutPatch, RunWebKitTestsRedTree, RunWebKitTestsRepeatFailuresRedTree, RunWebKitTestsRepeatFailuresWithoutPatchRedTree,
                    RunWebKitTestsWithoutPatchRedTree, AnalyzeLayoutTestsResultsRedTree, TestWithFailureCount, ShowIdentifier,
-                   Trigger, TransferToS3, UnApplyPatchIfRequired, UpdateWorkingDirectory, UploadBuiltProduct,
+                   Trigger, TransferToS3, UnApplyPatch, UpdateWorkingDirectory, UploadBuiltProduct,
                    UploadTestResults, ValidateChangeLogAndReviewer, ValidateCommiterAndReviewer, ValidateChange, VerifyGitHubIntegrity)
 
 # Workaround for https://github.com/buildbot/buildbot/issues/4669
@@ -1176,7 +1176,6 @@
         self.setupStep(CompileWebKitWithoutPatch())
         self.setProperty('fullPlatform', 'ios-simulator-11')
         self.setProperty('configuration', 'release')
-        self.setProperty('patchFailedToBuild', True)
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
                         logEnviron=False,
@@ -1191,7 +1190,6 @@
         self.setupStep(CompileWebKitWithoutPatch())
         self.setProperty('fullPlatform', 'mac-sierra')
         self.setProperty('configuration', 'debug')
-        self.setProperty('patchFailedTests', True)
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
                         logEnviron=False,
@@ -1203,15 +1201,7 @@
         self.expectOutcome(result=FAILURE, state_string='Failed to compile WebKit')
         return self.runStep()
 
-    def test_skip(self):
-        self.setupStep(CompileWebKitWithoutPatch())
-        self.setProperty('fullPlatform', 'ios-simulator-11')
-        self.setProperty('configuration', 'release')
-        self.expectHidden(True)
-        self.expectOutcome(result=SKIPPED, state_string='Skipped compiling WebKit')
-        return self.runStep()
 
-
 class TestAnalyzeCompileWebKitResults(BuildStepMixinAdditions, unittest.TestCase):
     def setUp(self):
         self.longMessage = True
@@ -1326,7 +1316,6 @@
         self.setupStep(CompileJSCWithoutPatch())
         self.setProperty('fullPlatform', 'jsc-only')
         self.setProperty('configuration', 'release')
-        self.setProperty('patchFailedToBuild', 'True')
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
                         logEnviron=False,
@@ -3145,7 +3134,7 @@
         return self.runStep()
 
 
-class TestUnApplyPatchIfRequired(BuildStepMixinAdditions, unittest.TestCase):
+class TestUnApplyPatch(BuildStepMixinAdditions, unittest.TestCase):
     def setUp(self):
         self.longMessage = True
         return self.setUpBuildStep()
@@ -3154,8 +3143,7 @@
         return self.tearDownBuildStep()
 
     def test_success(self):
-        self.setupStep(UnApplyPatchIfRequired())
-        self.setProperty('patchFailedToBuild', True)
+        self.setupStep(UnApplyPatch())
         self.expectHidden(False)
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
@@ -3168,8 +3156,7 @@
         return self.runStep()
 
     def test_failure(self):
-        self.setupStep(UnApplyPatchIfRequired())
-        self.setProperty('patchFailedTests', True)
+        self.setupStep(UnApplyPatch())
         self.expectHidden(False)
         self.expectRemoteCommands(
             ExpectShell(workdir='wkdir',
@@ -3182,13 +3169,7 @@
         self.expectOutcome(result=FAILURE, state_string='Unapplied patch (failure)')
         return self.runStep()
 
-    def test_skip(self):
-        self.setupStep(UnApplyPatchIfRequired())
-        self.expectHidden(True)
-        self.expectOutcome(result=SKIPPED, state_string='Unapplied patch (skipped)')
-        return self.runStep()
 
-
 class TestCheckChangeRelevance(BuildStepMixinAdditions, unittest.TestCase):
     def setUp(self):
         self.longMessage = True
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to