A/B testing results should be shown even if they were submitted to different platforms
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jun 2015 00:47:51 +0000 (00:47 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jun 2015 00:47:51 +0000 (00:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146219

Reviewed by Andreas Kling.

Fetch A/B testing results regardless of the platform to which results are submitted
by providing the platform ID to which the results were submitted for each test group.

* public/api/test-groups.php:
(main): Include the platform id in the test groups.
* public/v2/analysis.js:
(App.TestGroup._fetchTestResults): Fetch results from the platform associated with the group.

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

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/api/test-groups.php
Websites/perf.webkit.org/public/v2/analysis.js

index 514e2c2..9cc6ec0 100644 (file)
@@ -1,3 +1,18 @@
+2015-06-22  Ryosuke Niwa  <rniwa@webkit.org>
+
+        A/B testing results should be shown even if they were submitted to different platforms
+        https://bugs.webkit.org/show_bug.cgi?id=146219
+
+        Reviewed by Andreas Kling.
+
+        Fetch A/B testing results regardless of the platform to which results are submitted
+        by providing the platform ID to which the results were submitted for each test group.
+
+        * public/api/test-groups.php:
+        (main): Include the platform id in the test groups.
+        * public/v2/analysis.js:
+        (App.TestGroup._fetchTestResults): Fetch results from the platform associated with the group.
+
 2015-06-19  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Remove unnecessary svn:executable flags
index f822202..752e629 100644 (file)
@@ -35,8 +35,15 @@ function main($path) {
 
     $test_groups = array_map("format_test_group", $test_groups);
     $group_by_id = array();
-    foreach ($test_groups as &$group)
-        $group_by_id[$group['id']] = &$group;
+    foreach ($test_groups as &$group) {
+        $group_id = $group['id'];
+        $group_by_id[$group_id] = &$group;
+        $platforms = $db->query_and_fetch_all('SELECT DISTINCT(config_platform)
+            FROM test_configurations, test_runs, build_requests
+            WHERE run_config = config_id AND run_build = request_build AND request_group = $1', array($group_id));
+        if ($platforms)
+            $group['platform'] = $platforms[0]['config_platform'];
+    }
 
     $build_requests = $build_requests_fetcher->results();
     foreach ($build_requests as $request) {
index f801626..aa75907 100644 (file)
@@ -129,21 +129,23 @@ App.TestGroup = App.NameLabelModel.extend({
     createdAt: DS.attr('date'),
     buildRequests: DS.hasMany('buildRequests'),
     rootSets: DS.hasMany('rootSets'),
+    platform: DS.belongsTo('platform'),
     _fetchTestResults: function ()
     {
         var task = this.get('task');
-        if (!task)
+        var platform = this.get('platform');
+        if (!task || !platform)
             return null;
         var self = this;
         return App.Manifest.fetchRunsWithPlatformAndMetric(this.store,
-            task.get('platform').get('id'), task.get('metric').get('id'), this.get('id')).then(
+            platform.get('id'), task.get('metric').get('id'), this.get('id')).then(
             function (result) { self.set('testResults', result.data); },
             function (error) {
                 // FIXME: Somehow this never gets called.
                 alert('Failed to fetch the results:' + error);
                 return null;
             });
-    }.observes('task', 'task.platform', 'task.metric').on('init'),
+    }.observes('task', 'task.platform', 'task.metric', 'platform').on('init'),
 });
 
 App.TestGroup.create = function (analysisTask, name, rootSets, repetitionCount)