Title: [275283] trunk/Tools
Revision
275283
Author
aakash_j...@apple.com
Date
2021-03-31 09:10:29 -0700 (Wed, 31 Mar 2021)

Log Message

Add build step to run layout tests for multiple iterations
https://bugs.webkit.org/show_bug.cgi?id=223950

Reviewed by Jonathan Bedard.

* CISupport/ews-build/steps.py:
(RunWebKitTestsInStressMode):
(RunWebKitTestsInStressMode.setLayoutTestCommand):
(RunWebKitTestsInStressMode.evaluateCommand):
* CISupport/ews-build/steps_unittest.py: Added unit-tests.

Modified Paths

Diff

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


--- trunk/Tools/CISupport/ews-build/steps.py	2021-03-31 16:03:32 UTC (rev 275282)
+++ trunk/Tools/CISupport/ews-build/steps.py	2021-03-31 16:10:29 UTC (rev 275283)
@@ -2248,6 +2248,37 @@
         return super(RunWebKitTests, self).getResultSummary()
 
 
+class RunWebKitTestsInStressMode(RunWebKitTests):
+    name = 'run-layout-tests-in-stress-mode'
+    suffix = 'stress-mode'
+    EXIT_AFTER_FAILURES = '10'
+    NUM_ITERATIONS = 100
+
+    def setLayoutTestCommand(self):
+        RunWebKitTests.setLayoutTestCommand(self)
+
+        self.setCommand(self.command + ['--iterations', self.NUM_ITERATIONS])
+        modified_tests = self.getProperty('modified_tests')
+        if modified_tests:
+            self.setCommand(self.command + modified_tests)
+
+    def evaluateCommand(self, cmd):
+        rc = self.evaluateResult(cmd)
+        if rc == SUCCESS or rc == WARNINGS:
+            message = 'Passed layout tests'
+            self.descriptionDone = message
+            self.build.results = SUCCESS
+            self.setProperty('build_summary', message)
+        else:
+            self.setProperty('build_summary', 'Found test failures')
+            self.build.addStepsAfterCurrentStep([
+                ArchiveTestResults(),
+                UploadTestResults(identifier=self.suffix),
+                ExtractTestResults(identifier=self.suffix),
+            ])
+        return rc
+
+
 class ReRunWebKitTests(RunWebKitTests):
     name = 're-run-layout-tests'
     NUM_FAILURES_TO_DISPLAY = 10

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


--- trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-03-31 16:03:32 UTC (rev 275282)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-03-31 16:10:29 UTC (rev 275283)
@@ -51,7 +51,7 @@
                    ReRunWebKitTests, RunAPITests, RunAPITestsWithoutPatch, RunBindingsTests, RunBuildWebKitOrgUnitTests,
                    RunBuildbotCheckConfigForBuildWebKit, RunBuildbotCheckConfigForEWS, RunEWSUnitTests, RunResultsdbpyTests,
                    RunJavaScriptCoreTests, RunJSCTestsWithoutPatch, RunWebKit1Tests, RunWebKitPerlTests, RunWebKitPyPython2Tests,
-                   RunWebKitPyPython3Tests, RunWebKitTests, RunWebKitTestsWithoutPatch, TestWithFailureCount, ShowIdentifier,
+                   RunWebKitPyPython3Tests, RunWebKitTests, RunWebKitTestsInStressMode, RunWebKitTestsWithoutPatch, TestWithFailureCount, ShowIdentifier,
                    Trigger, TransferToS3, UnApplyPatchIfRequired, UpdateWorkingDirectory, UploadBuiltProduct,
                    UploadTestResults, ValidateCommiterAndReviewer, ValidatePatch)
 
@@ -1881,6 +1881,62 @@
         return rc
 
 
+class TestRunWebKitTestsInStressMode(BuildStepMixinAdditions, unittest.TestCase):
+    def setUp(self):
+        self.longMessage = True
+        self.jsonFileName = 'layout-test-results/full_results.json'
+        return self.setUpBuildStep()
+
+    def tearDown(self):
+        return self.tearDownBuildStep()
+
+    def configureStep(self):
+        self.setupStep(RunWebKitTestsInStressMode())
+        self.property_exceed_failure_limit = 'first_results_exceed_failure_limit'
+        self.property_failures = 'first_run_failures'
+
+    def test_success(self):
+        self.configureStep()
+        self.setProperty('fullPlatform', 'ios-simulator')
+        self.setProperty('configuration', 'release')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        logfiles={'json': self.jsonFileName},
+                        logEnviron=False,
+                        command=['python',
+                                 'Tools/Scripts/run-webkit-tests',
+                                 '--no-build', '--no-show-results', '--no-new-test-results', '--clobber-old-results',
+                                 '--release', '--results-directory', 'layout-test-results', '--debug-rwt-logging',
+                                 '--exit-after-n-failures', '10', '--skip-failing-tests',
+                                 '--iterations', 100],
+                        )
+            + 0,
+        )
+        self.expectOutcome(result=SUCCESS, state_string='Passed layout tests')
+        return self.runStep()
+
+    def test_failure(self):
+        self.configureStep()
+        self.setProperty('fullPlatform', 'ios-simulator')
+        self.setProperty('configuration', 'release')
+        self.expectRemoteCommands(
+            ExpectShell(workdir='wkdir',
+                        logfiles={'json': self.jsonFileName},
+                        logEnviron=False,
+                        command=['python',
+                                 'Tools/Scripts/run-webkit-tests',
+                                 '--no-build', '--no-show-results', '--no-new-test-results', '--clobber-old-results',
+                                 '--release', '--results-directory', 'layout-test-results', '--debug-rwt-logging',
+                                 '--exit-after-n-failures', '10', '--skip-failing-tests',
+                                 '--iterations', 100],
+                        )
+            + ExpectShell.log('stdio', stdout='9 failures found.')
+            + 2,
+        )
+        self.expectOutcome(result=FAILURE, state_string='layout-tests (failure)')
+        return self.runStep()
+
+
 class TestRunWebKitTestsWithoutPatch(BuildStepMixinAdditions, unittest.TestCase):
     def setUp(self):
         self.longMessage = True

Modified: trunk/Tools/ChangeLog (275282 => 275283)


--- trunk/Tools/ChangeLog	2021-03-31 16:03:32 UTC (rev 275282)
+++ trunk/Tools/ChangeLog	2021-03-31 16:10:29 UTC (rev 275283)
@@ -1,5 +1,18 @@
 2021-03-31  Aakash Jain  <aakash_j...@apple.com>
 
+        Add build step to run layout tests for multiple iterations
+        https://bugs.webkit.org/show_bug.cgi?id=223950
+
+        Reviewed by Jonathan Bedard.
+
+        * CISupport/ews-build/steps.py:
+        (RunWebKitTestsInStressMode):
+        (RunWebKitTestsInStressMode.setLayoutTestCommand):
+        (RunWebKitTestsInStressMode.evaluateCommand):
+        * CISupport/ews-build/steps_unittest.py: Added unit-tests.
+
+2021-03-31  Aakash Jain  <aakash_j...@apple.com>
+
         Add a fast-cq mode for commit-queue which will skip build and test
         https://bugs.webkit.org/show_bug.cgi?id=223954
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to