Title: [198337] releases/WebKitGTK/webkit-2.12/Tools
Revision
198337
Author
[email protected]
Date
2016-03-17 10:03:21 -0700 (Thu, 17 Mar 2016)

Log Message

Merge r197505 - [GTK] Run the run-benchmark script on the performance bot.
https://bugs.webkit.org/show_bug.cgi?id=154595

Reviewed by Carlos Garcia Campos.

* BuildSlaveSupport/build.webkit.org-config/master.cfg: Add new RunBenchmarkTests step on the perf bots (only for the GTK+ port at this moment).
(RunBenchmarkTests):
(RunBenchmarkTests.start):
(RunBenchmarkTests.getText):
(RunBenchmarkTests.getText2):
(BuildAndPerfTestFactory.__init__):
(DownloadAndPerfTestFactory.__init__):
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py: Add new test for RunBenchmarkTests and update expected steps of GTK+ perf bot.
(RunBenchmarkTest):
(RunBenchmarkTest.assertResults):
(RunBenchmarkTest.test_success):
(RunBenchmarkTest.test_tests_failed):
* Scripts/webkitpy/benchmark_runner/benchmark_runner.py: Log both the current iteration as also the total iterations for the current benchmark/plan.
(BenchmarkRunner._run_benchmark):
* Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py: Use python logging also for errors.
(GTKMiniBrowserDriver.close_browsers):
* Scripts/webkitpy/benchmark_runner/run_benchmark.py: Implement support for running all available benchmark plans.
(parse_args):
(start):
(main):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg (198336 => 198337)


--- releases/WebKitGTK/webkit-2.12/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg	2016-03-17 17:02:58 UTC (rev 198336)
+++ releases/WebKitGTK/webkit-2.12/Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg	2016-03-17 17:03:21 UTC (rev 198337)
@@ -701,7 +701,31 @@
 
         return [self.name]
 
+class RunBenchmarkTests(shell.Test):
+    name = "benchmark-test"
+    description = ["benchmark tests running"]
+    descriptionDone = ["benchmark tests"]
+    # Buildbot default timeout without output for a step is 1200.
+    # The current maximum timeout for a benchmark plan is also 1200.
+    # So raise the buildbot timeout to avoid aborting this whole step when a test timeouts.
+    timeout = 1500
+    command = ["python", "./Tools/Scripts/run-benchmark", "--allplans"]
 
+    def start(self):
+        platform = self.getProperty("platform")
+        if platform == "gtk":
+            command += ["--platform", "gtk", "--browser", "minibrowser"]
+        self.setCommand(self.command)
+        return shell.Test.start(self)
+
+    def getText(self, cmd, results):
+        return self.getText2(cmd, results)
+
+    def getText2(self, cmd, results):
+        if results != SUCCESS:
+            return ["%d benchmark tests failed" % cmd.rc]
+        return [self.name]
+
 class ArchiveTestResults(shell.ShellCommand):
     command = ["python", "./Tools/BuildSlaveSupport/test-result-archive",
                WithProperties("--platform=%(platform)s"), WithProperties("--%(configuration)s"), "archive"]
@@ -883,6 +907,8 @@
         Factory.__init__(self, platform, configuration, architectures, False, additionalArguments, SVNMirror, **kwargs)
         self.addStep(CompileWebKit())
         self.addStep(RunAndUploadPerfTests())
+        if platform == "gtk":
+            self.addStep(RunBenchmarkTests())
 
 class DownloadAndPerfTestFactory(Factory):
     def __init__(self, platform, configuration, architectures, additionalArguments=None, SVNMirror=None, **kwargs):
@@ -890,6 +916,8 @@
         self.addStep(DownloadBuiltProduct())
         self.addStep(ExtractBuiltProduct())
         self.addStep(RunAndUploadPerfTests())
+        if platform == "gtk":
+            self.addStep(RunBenchmarkTests())
 
 class PlatformSpecificScheduler(AnyBranchScheduler):
     def __init__(self, platform, branch, **kwargs):

Modified: releases/WebKitGTK/webkit-2.12/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py (198336 => 198337)


--- releases/WebKitGTK/webkit-2.12/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py	2016-03-17 17:02:58 UTC (rev 198336)
+++ releases/WebKitGTK/webkit-2.12/Tools/BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py	2016-03-17 17:03:21 UTC (rev 198337)
@@ -414,7 +414,7 @@
     'GTK Linux 64-bit Debug (Build)' : ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'compile-webkit', 'archive-built-product', 'upload', 'trigger'],
     'GTK Linux 64-bit Debug (Tests)' : ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'download-built-product', 'extract-built-product', 'jscore-test', 'layout-test', 'webkitpy-test', 'webkitperl-test', 'bindings-generation-tests', 'archive-test-results', 'upload', 'MasterShellCommand', 'API tests', 'WebKit GObject DOM bindings API break tests'],
     'GTK Linux 64-bit Release (Build)' : ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'compile-webkit', 'archive-built-product', 'upload', 'trigger'],
-    'GTK Linux 64-bit Release (Perf)' : ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'download-built-product', 'extract-built-product', 'perf-test'],
+    'GTK Linux 64-bit Release (Perf)' : ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'download-built-product', 'extract-built-product', 'perf-test', 'benchmark-test'],
     'GTK Linux 64-bit Release (Tests)' : ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'download-built-product', 'extract-built-product', 'jscore-test', 'layout-test', 'webkitpy-test', 'webkitperl-test', 'bindings-generation-tests', 'archive-test-results', 'upload', 'MasterShellCommand', 'API tests', 'WebKit GObject DOM bindings API break tests'],
     'GTK Linux ARM Release' : ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'jhbuild', 'compile-webkit', 'jscore-test', 'webkitpy-test', 'webkitperl-test', 'bindings-generation-tests', 'API tests', 'WebKit GObject DOM bindings API break tests'],
 
@@ -528,6 +528,22 @@
         self.assertResults(-1, "timeout")
 
 
+class RunBenchmarkTest(unittest.TestCase):
+    def assertResults(self, rc, expected_text):
+        cmd = StubRemoteCommand(rc, expected_text)
+        step = RunBenchmarkTests()
+        step.commandComplete(cmd)
+        actual_results = step.evaluateCommand(cmd)
+        actual_text = str(step.getText2(cmd, actual_results)[0])
+        self.assertEqual(expected_text, actual_text)
+
+    def test_success(self):
+        self.assertResults(0, "benchmark-test")
+
+    def test_tests_failed(self):
+        self.assertResults(7, "7 benchmark tests failed")
+
+
 # FIXME: We should run this file as part of test-webkitpy.
 # Unfortunately test-webkitpy currently requires that unittests
 # be located in a directory with a valid module name.

Modified: releases/WebKitGTK/webkit-2.12/Tools/ChangeLog (198336 => 198337)


--- releases/WebKitGTK/webkit-2.12/Tools/ChangeLog	2016-03-17 17:02:58 UTC (rev 198336)
+++ releases/WebKitGTK/webkit-2.12/Tools/ChangeLog	2016-03-17 17:03:21 UTC (rev 198337)
@@ -1,3 +1,31 @@
+2016-03-03  Carlos Alberto Lopez Perez  <[email protected]>
+
+        [GTK] Run the run-benchmark script on the performance bot.
+        https://bugs.webkit.org/show_bug.cgi?id=154595
+
+        Reviewed by Carlos Garcia Campos.
+
+        * BuildSlaveSupport/build.webkit.org-config/master.cfg: Add new RunBenchmarkTests step on the perf bots (only for the GTK+ port at this moment).
+        (RunBenchmarkTests):
+        (RunBenchmarkTests.start):
+        (RunBenchmarkTests.getText):
+        (RunBenchmarkTests.getText2):
+        (BuildAndPerfTestFactory.__init__):
+        (DownloadAndPerfTestFactory.__init__):
+        * BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py: Add new test for RunBenchmarkTests and update expected steps of GTK+ perf bot.
+        (RunBenchmarkTest):
+        (RunBenchmarkTest.assertResults):
+        (RunBenchmarkTest.test_success):
+        (RunBenchmarkTest.test_tests_failed):
+        * Scripts/webkitpy/benchmark_runner/benchmark_runner.py: Log both the current iteration as also the total iterations for the current benchmark/plan.
+        (BenchmarkRunner._run_benchmark):
+        * Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py: Use python logging also for errors.
+        (GTKMiniBrowserDriver.close_browsers):
+        * Scripts/webkitpy/benchmark_runner/run_benchmark.py: Implement support for running all available benchmark plans.
+        (parse_args):
+        (start):
+        (main):
+
 2016-02-23  Carlos Alberto Lopez Perez  <[email protected]>
 
         [GTK] Allow to run the WebKitGTK+ MiniBrowser with the run-benchmark script.

Modified: releases/WebKitGTK/webkit-2.12/Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py (198336 => 198337)


--- releases/WebKitGTK/webkit-2.12/Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py	2016-03-17 17:02:58 UTC (rev 198336)
+++ releases/WebKitGTK/webkit-2.12/Tools/Scripts/webkitpy/benchmark_runner/benchmark_runner.py	2016-03-17 17:03:21 UTC (rev 198337)
@@ -62,7 +62,7 @@
     def _run_benchmark(self, count, web_root):
         results = []
         for iteration in xrange(1, count + 1):
-            _log.info('Start the iteration {current_iteration} of current benchmark'.format(current_iteration=iteration))
+            _log.info('Start the iteration {current_iteration} of {iterations} for current benchmark'.format(current_iteration=iteration, iterations=count))
             try:
                 result = None
                 self._http_server_driver.serve(web_root)
@@ -78,7 +78,7 @@
                 self._browser_driver.restore_env()
                 self._browser_driver.close_browsers()
                 self._http_server_driver.kill_server()
-            _log.info('End of {current_iteration} iteration of current benchmark'.format(current_iteration=iteration))
+            _log.info('End the iteration {current_iteration} of {iterations} for current benchmark'.format(current_iteration=iteration, iterations=count))
         results = self._wrap(results)
         self._dump(results, self._output_file if self._output_file else self._plan['output_file'])
         self.show_results(results, self._scale_unit)

Modified: releases/WebKitGTK/webkit-2.12/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py (198336 => 198337)


--- releases/WebKitGTK/webkit-2.12/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py	2016-03-17 17:02:58 UTC (rev 198336)
+++ releases/WebKitGTK/webkit-2.12/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py	2016-03-17 17:03:21 UTC (rev 198337)
@@ -49,4 +49,5 @@
     def close_browsers(self):
         super(GTKMiniBrowserDriver, self).close_browsers()
         if self._minibrowser_process and self._minibrowser_process.returncode:
-            sys.exit('MiniBrowser crashed with exitcode %d' % self._minibrowser_process.returncode)
+            _log.error('MiniBrowser crashed with exitcode %d' % self._minibrowser_process.returncode)
+            sys.exit(1)

Modified: releases/WebKitGTK/webkit-2.12/Tools/Scripts/webkitpy/benchmark_runner/run_benchmark.py (198336 => 198337)


--- releases/WebKitGTK/webkit-2.12/Tools/Scripts/webkitpy/benchmark_runner/run_benchmark.py	2016-03-17 17:02:58 UTC (rev 198336)
+++ releases/WebKitGTK/webkit-2.12/Tools/Scripts/webkitpy/benchmark_runner/run_benchmark.py	2016-03-17 17:03:21 UTC (rev 198337)
@@ -28,6 +28,7 @@
     mutual_group = parser.add_mutually_exclusive_group(required=True)
     mutual_group.add_argument('--read-results-json', dest='json_file', help='Specify file you want to format')
     mutual_group.add_argument('--plan', dest='plan', help='Benchmark plan to run. e.g. speedometer, jetstream')
+    mutual_group.add_argument('--allplans', action='', help='Run all available benchmark plans sequentially')
 
     args = parser.parse_args()
 
@@ -45,6 +46,26 @@
     if args.json_file:
         BenchmarkRunner.show_results(json.load(open(args.json_file, 'r')), args.scale_unit)
         return
+    if args.allplans:
+        failed = []
+        plandir = os.path.join(os.path.dirname(__file__), 'data/plans')
+        planlist = [os.path.splitext(f)[0] for f in os.listdir(plandir) if f.endswith('.plan')]
+        if not planlist:
+            raise Exception('Cant find any .plan file in directory %s' % plandir)
+        for plan in sorted(planlist):
+            _log.info('Starting benchmark plan: %s' % plan)
+            try:
+                runner = BenchmarkRunner(plan, args.localCopy, args.countOverride, args.buildDir, args.output, args.platform, args.browser, args.scale_unit, args.device_id)
+                runner.execute()
+                _log.info('Finished benchmark plan: %s' % plan)
+            except KeyboardInterrupt:
+                raise
+            except:
+                failed.append(plan)
+                _log.error('Error running benchmark plan: %s' % plan)
+        if failed:
+            _log.error('The following benchmark plans have failed: %s' % failed)
+        return len(failed)
     runner = BenchmarkRunner(args.plan, args.localCopy, args.countOverride, args.buildDir, args.output, args.platform, args.browser, args.scale_unit, args.device_id)
     runner.execute()
 
@@ -58,4 +79,4 @@
 
 
 def main():
-    start(parse_args())
+    return start(parse_args())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to