perf-o-matic should store chromium svn revision
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Feb 2012 21:10:22 +0000 (21:10 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Feb 2012 21:10:22 +0000 (21:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77725

Reviewed by Dirk Pranke.

.:

Store both WebKit and Chromium revisions when both are reported.

* Websites/webkit-perf.appspot.com/models.py:
(Build):
* Websites/webkit-perf.appspot.com/report_handler.py:
(ReportHandler.post):
(ReportHandler._create_build_if_possible):
(ReportHandler._create_build_if_possible.execute):
* Websites/webkit-perf.appspot.com/static/manual-submit.html:

Tools:

Report both WebKit and Chromium revisions to the graph server. Renamed test_repository_paths to
repository_paths since it's nothing to do with tests. Also refactored scm so that head_svn_revision
is implemented in terms of newly added svn_revision.

* Scripts/webkitpy/common/checkout/scm/git.py:
(Git.svn_revision):
* Scripts/webkitpy/common/checkout/scm/scm.py:
(SCM.head_svn_revision):
(SCM):
(SCM.svn_revision):
* Scripts/webkitpy/common/checkout/scm/scm_mock.py:
(MockSCM.svn_revision):
* Scripts/webkitpy/common/checkout/scm/svn.py:
(SVN.svn_revision):
* Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
(JSONLayoutResultsGenerator.__init__):
* Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
(JSONResultsGeneratorBase._insert_generic_metadata):
* Scripts/webkitpy/layout_tests/port/base.py:
(Port.repository_paths):
* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumPort.repository_paths):
* Scripts/webkitpy/performance_tests/perftestsrunner.py:
(PerfTestsRunner._generate_json):
* Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
(test_run_test_set_with_json_output):
(test_run_test_set_with_json_source):
(test_run_test_set_with_multiple_repositories):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106687 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
ChangeLog
Tools/ChangeLog
Tools/Scripts/webkitpy/common/checkout/scm/git.py
Tools/Scripts/webkitpy/common/checkout/scm/scm.py
Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
Tools/Scripts/webkitpy/common/checkout/scm/svn.py
Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
Tools/Scripts/webkitpy/layout_tests/port/base.py
Tools/Scripts/webkitpy/layout_tests/port/chromium.py
Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
Websites/webkit-perf.appspot.com/models.py
Websites/webkit-perf.appspot.com/report_handler.py
Websites/webkit-perf.appspot.com/static/manual-submit.html

index 0ce25e3..0894333 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2012-02-03  Ryosuke Niwa  <rniwa@webkit.org>
+
+        perf-o-matic should store chromium svn revision
+        https://bugs.webkit.org/show_bug.cgi?id=77725
+
+        Reviewed by Dirk Pranke.
+
+        Store both WebKit and Chromium revisions when both are reported.
+
+        * Websites/webkit-perf.appspot.com/models.py:
+        (Build):
+        * Websites/webkit-perf.appspot.com/report_handler.py:
+        (ReportHandler.post):
+        (ReportHandler._create_build_if_possible):
+        (ReportHandler._create_build_if_possible.execute):
+        * Websites/webkit-perf.appspot.com/static/manual-submit.html:
+
 2012-02-03  Simon Hausmann  <simon.hausmann@nokia.com>
 
         [Qt] Replace GNU linker script for exports with export macros in WTF/JSC
index 1d7b719..c02bb2e 100644 (file)
@@ -1,3 +1,39 @@
+2012-02-03  Ryosuke Niwa  <rniwa@webkit.org>
+
+        perf-o-matic should store chromium svn revision
+        https://bugs.webkit.org/show_bug.cgi?id=77725
+
+        Reviewed by Dirk Pranke.
+
+        Report both WebKit and Chromium revisions to the graph server. Renamed test_repository_paths to
+        repository_paths since it's nothing to do with tests. Also refactored scm so that head_svn_revision
+        is implemented in terms of newly added svn_revision.
+
+        * Scripts/webkitpy/common/checkout/scm/git.py:
+        (Git.svn_revision):
+        * Scripts/webkitpy/common/checkout/scm/scm.py:
+        (SCM.head_svn_revision):
+        (SCM):
+        (SCM.svn_revision):
+        * Scripts/webkitpy/common/checkout/scm/scm_mock.py:
+        (MockSCM.svn_revision):
+        * Scripts/webkitpy/common/checkout/scm/svn.py:
+        (SVN.svn_revision):
+        * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+        (JSONLayoutResultsGenerator.__init__):
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+        (JSONResultsGeneratorBase._insert_generic_metadata):
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        (Port.repository_paths):
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        (ChromiumPort.repository_paths):
+        * Scripts/webkitpy/performance_tests/perftestsrunner.py:
+        (PerfTestsRunner._generate_json):
+        * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
+        (test_run_test_set_with_json_output):
+        (test_run_test_set_with_json_source):
+        (test_run_test_set_with_multiple_repositories):
+
 2012-02-03  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
 
         [Qt] Split QQuickWebViewPrivate in two classes, for desktop and touch behavior.
index 866b24c..7c17f28 100644 (file)
@@ -229,9 +229,9 @@ class Git(SCM, SVNRepository):
     def display_name(self):
         return "git"
 
-    def head_svn_revision(self):
+    def svn_revision(self, path):
         _log.debug('Running git.head_svn_revision... (Temporary logging message)')
-        git_log = self.run(['git', 'log', '-25'])
+        git_log = self.run(['git', 'log', '-25', path])
         match = re.search("^\s*git-svn-id:.*@(?P<svn_revision>\d+)\ ", git_log, re.MULTILINE)
         if not match:
             return ""
index 4b581b1..432d6ca 100644 (file)
@@ -182,6 +182,9 @@ class SCM:
         self._subclass_must_implement()
 
     def head_svn_revision(self):
+        return self.svn_revision(self.checkout_root)
+
+    def svn_revision(self, path):
         self._subclass_must_implement()
 
     def create_patch(self, git_commit=None, changed_files=None):
index 78af67c..f203cfa 100644 (file)
@@ -68,6 +68,9 @@ class MockSCM(object):
     def head_svn_revision(self):
         return 1234
 
+    def svn_revision(self, path):
+        return 5678
+
     def create_patch(self, git_commit, changed_files=None):
         return "Patch1"
 
index 3f583a7..ebfbea2 100644 (file)
@@ -237,8 +237,8 @@ class SVN(SCM, SVNRepository):
     def display_name(self):
         return "svn"
 
-    def head_svn_revision(self):
-        return self.value_from_svn_info(self.checkout_root, 'Revision')
+    def svn_revision(self, path):
+        return self.value_from_svn_info(path, 'Revision')
 
     # FIXME: This method should be on Checkout.
     def create_patch(self, git_commit=None, changed_files=None):
index 142d9a5..ce7ba45 100644 (file)
@@ -64,7 +64,7 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase
         """
         super(JSONLayoutResultsGenerator, self).__init__(
             port, builder_name, build_name, build_number, results_file_base_path,
-            builder_base_url, {}, port.test_repository_paths(),
+            builder_base_url, {}, port.repository_paths(),
             test_results_server, test_type, master_name)
 
         self._expectations = expectations
index b073d40..99979e9 100644 (file)
@@ -528,6 +528,10 @@ class JSONResultsGeneratorBase(object):
 
         # Include SVN revisions for the given repositories.
         for (name, path) in self._svn_repositories:
+            # Note: for JSON file's backward-compatibility we use 'chrome' rather
+            # than 'chromium' here.
+            if name == 'chromium':
+                name = 'chrome'
             self._insert_item_into_raw_list(results_for_builder,
                 self._get_svn_revision(path),
                 name + 'Revision')
index a8b98fd..cd1b6e6 100755 (executable)
@@ -900,12 +900,10 @@ class Port(object):
         sync up the two repos."""
         return None
 
-    def test_repository_paths(self):
-        """Returns a list of (repository_name, repository_path) tuples
-        of its depending code base.  By default it returns a list that only
-        contains a ('webkit', <webkitRepossitoryPath>) tuple.
-        """
-        return [('webkit', self.layout_tests_dir())]
+    def repository_paths(self):
+        """Returns a list of (repository_name, repository_path) tuples of its depending code base.
+        By default it returns a list that only contains a ('webkit', <webkitRepossitoryPath>) tuple."""
+        return [('webkit', self.webkit_base())]
 
 
     _WDIFF_DEL = '##WDIFF_DEL##'
index c530d7c..199a2ec 100755 (executable)
@@ -335,11 +335,9 @@ class ChromiumPort(Port):
             is_lint_mode=False, overrides=overrides_str)
         return expectations.get_tests_with_result_type(test_expectations.SKIP)
 
-    def test_repository_paths(self):
-        # Note: for JSON file's backward-compatibility we use 'chrome' rather
-        # than 'chromium' here.
-        repos = super(ChromiumPort, self).test_repository_paths()
-        repos.append(('chrome', self.path_from_chromium_base()))
+    def repository_paths(self):
+        repos = super(ChromiumPort, self).repository_paths()
+        repos.append(('chromium', self.path_from_chromium_base('build')))
         return repos
 
     #
index 4d88d56..87e7e6d 100644 (file)
@@ -145,8 +145,9 @@ class PerfTestsRunner(object):
         return unexpected
 
     def _generate_json(self, timestamp, output_json_path, source_json_path, branch, platform, builder_name, build_number):
-        revision = self._host.scm().head_svn_revision()
-        contents = {'timestamp': int(timestamp), 'revision': revision, 'results': self._results}
+        contents = {'timestamp': int(timestamp), 'results': self._results}
+        for (name, path) in self._port.repository_paths():
+            contents[name + '-revision'] = self._host.scm().svn_revision(path)
 
         for key, value in {'branch': branch, 'platform': platform, 'builder-name': builder_name, 'build-number': build_number}.items():
             if value:
index 58bd377..4868d79 100755 (executable)
@@ -200,7 +200,7 @@ max 1120
             "timestamp": 123456789, "results":
             {"Bindings/event-target-wrapper": {"max": 1510, "avg": 1489.05, "median": 1487, "min": 1471, "stdev": 14.46},
             "group_name:test_name": 42},
-            "revision": 1234})
+            "webkit-revision": 5678})
 
     def test_run_test_set_with_json_source(self):
         buildbot_output = array_stream.ArrayStream()
@@ -220,9 +220,20 @@ max 1120
             "timestamp": 123456789, "results":
             {"Bindings/event-target-wrapper": {"max": 1510, "avg": 1489.05, "median": 1487, "min": 1471, "stdev": 14.46},
             "group_name:test_name": 42},
-            "revision": 1234,
+            "webkit-revision": 5678,
             "key": "value"})
 
+    def test_run_test_set_with_multiple_repositories(self):
+        buildbot_output = array_stream.ArrayStream()
+        runner = self.create_runner(buildbot_output, args=['--output-json-path=/mock-checkout/output.json'])
+        runner._host.filesystem.files[runner._base_path + '/inspector/pass.html'] = True
+        runner._timestamp = 123456789
+        runner._port.repository_paths = lambda: [('webkit', '/mock-checkout'), ('some', '/mock-checkout/some')]
+        self.assertEqual(runner.run(), 0)
+
+        self.assertEqual(json.loads(runner._host.filesystem.files['/mock-checkout/output.json']), {
+            "timestamp": 123456789, "results": {"group_name:test_name": 42.0}, "webkit-revision": 5678, "some-revision": 5678})
+
     def test_run_with_upload_json(self):
         runner = self.create_runner(args=['--output-json-path=/mock-checkout/output.json',
             '--test-results-server', 'some.host', '--platform', 'platform1', '--builder-name', 'builder1', '--build-number', '123'])
index 26b4f03..ebd3a61 100644 (file)
@@ -90,6 +90,7 @@ class Build(db.Model):
     builder = db.ReferenceProperty(Builder, required=True, collection_name='builder_key')
     buildNumber = db.IntegerProperty(required=True)
     revision = db.IntegerProperty(required=True)
+    chromiumRevision = db.IntegerProperty()
     timestamp = db.DateTimeProperty(required=True)
 
 
index ce83287..060294d 100644 (file)
@@ -67,8 +67,9 @@ class ReportHandler(webapp2.RequestHandler):
         branch = self._model_by_key_name_in_body_or_error(Branch, 'branch')
         platform = self._model_by_key_name_in_body_or_error(Platform, 'platform')
         build_number = self._integer_in_body('build-number')
-        revision = self._integer_in_body('revision')
         timestamp = self._timestamp_in_body()
+        revision = self._integer_in_body('webkit-revision')
+        chromium_revision = self._integer_in_body('webkit-revision') if 'chromium-revision' in self._body else None
 
         failed = False
         if builder and not (self.bypass_authentication() or builder.authenticate(self._body.get('password', ''))):
@@ -82,7 +83,7 @@ class ReportHandler(webapp2.RequestHandler):
         if not (builder and branch and platform and build_number and revision and timestamp) or failed:
             return
 
-        build = self._create_build_if_possible(builder, build_number, branch, platform, revision, timestamp)
+        build = self._create_build_if_possible(builder, build_number, branch, platform, timestamp, revision, chromium_revision)
         if not build:
             return
 
@@ -162,7 +163,7 @@ class ReportHandler(webapp2.RequestHandler):
 
         return True
 
-    def _create_build_if_possible(self, builder, build_number, branch, platform, revision, timestamp):
+    def _create_build_if_possible(self, builder, build_number, branch, platform, timestamp, revision, chromium_revision):
         key_name = builder.name + ':' + str(int(time.mktime(timestamp.timetuple())))
 
         def execute():
@@ -171,7 +172,7 @@ class ReportHandler(webapp2.RequestHandler):
                 return self._output('The build at %s already exists for %s' % (str(timestamp), builder.name))
 
             return Build(branch=branch, platform=platform, builder=builder, buildNumber=build_number,
-                timestamp=timestamp, revision=revision, key_name=key_name).put()
+                timestamp=timestamp, revision=revision, chromiumRevision=chromium_revision, key_name=key_name).put()
         return db.run_in_transaction(execute)
 
     def _add_test_if_needed(self, test_name, branch, platform):
index 345f0b4..f28d433 100644 (file)
@@ -55,7 +55,7 @@ $('data').value = JSON.stringify({
     'builder-name': 'Chromium Mac Release (Perf)',
     'build-number': '123',
     'timestamp': parseInt(Date.now() / 1000),
-    'revision': 104856,
+    'webkit-revision': 104856,
     'results':
         {
             'webkit_style_test': {'avg': 100, 'median': 102, 'stdev': 5, 'min': 90, 'max': 110},