The queue page is broke when there is a custom analysis task
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 May 2017 08:15:35 +0000 (08:15 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 May 2017 08:15:35 +0000 (08:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172631

Reviewed by Antti Koivisto.

Fix the bug that we were always assuming each build request to have a test associated.

* public/v3/models/test-group.js:
(TestGroup.createAndRefetchTestGroups): Fixed the bug that we were referring to a non-existent variable task.
* public/v3/pages/build-request-queue-page.js:
(BuildRequestQueuePage.prototype._constructBuildRequestTable): Fixed the bug. Collect every request in the group
and then find the first test request's test name. Make it clear that we're waiting for a build as needed.

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

Websites/perf.webkit.org/ChangeLog
Websites/perf.webkit.org/public/v3/models/test-group.js
Websites/perf.webkit.org/public/v3/pages/build-request-queue-page.js

index a12b5e7..49068c8 100644 (file)
@@ -1,3 +1,18 @@
+2017-05-26  Ryosuke Niwa  <rniwa@webkit.org>
+
+        The queue page is broke when there is a custom analysis task
+        https://bugs.webkit.org/show_bug.cgi?id=172631
+
+        Reviewed by Antti Koivisto.
+
+        Fix the bug that we were always assuming each build request to have a test associated.
+
+        * public/v3/models/test-group.js:
+        (TestGroup.createAndRefetchTestGroups): Fixed the bug that we were referring to a non-existent variable task.
+        * public/v3/pages/build-request-queue-page.js:
+        (BuildRequestQueuePage.prototype._constructBuildRequestTable): Fixed the bug. Collect every request in the group
+        and then find the first test request's test name. Make it clear that we're waiting for a build as needed.
+
 2017-05-25  Ryosuke Niwa  <rniwa@webkit.org>
 
         Syncing script shouldn't schedule a build request when there is a build from another test group in progress
index b6db583..93318fb 100644 (file)
@@ -219,7 +219,7 @@ class TestGroup extends LabeledObject {
             name: name,
             repetitionCount: repetitionCount,
             revisionSets: revisionSets,
-        }).then((data) => this.fetchForTask(task.id(), true));
+        }).then((data) => this.fetchForTask(data['taskId'], true));
     }
 
     static _revisionSetsFromCommitSets(commitSets)
index 9317d98..e0785ff 100644 (file)
@@ -42,14 +42,18 @@ class BuildRequestQueuePage extends PageWithHeading {
 
         const rowList = [];
         const requestCountForGroup = {};
+        const requestsByGroup = {};
         let previousRow = null;
         let requestCount = 0;
-        for (let request of buildRequests) {
+        for (const request of buildRequests) {
             const groupId = request.testGroupId();
-            if (groupId in requestCountForGroup)
+            if (groupId in requestCountForGroup) {
                 requestCountForGroup[groupId]++;
-            else
-                requestCountForGroup[groupId] = 1
+                requestsByGroup[groupId].push(request);
+            } else {
+                requestCountForGroup[groupId] = 1;
+                requestsByGroup[groupId] = [request];
+            }
 
             if (request.hasFinished())
                 continue;
@@ -90,13 +94,22 @@ class BuildRequestQueuePage extends PageWithHeading {
                 const request = entry.request;
                 const taskId = request.analysisTaskId();
                 const task = AnalysisTask.findById(taskId);
+                const requestsForGroup = requestsByGroup[request.testGroupId()];
+                const firstOrder = requestsForGroup[0].order();
+                let testName = null;
+                if (request.test())
+                    testName = request.test().fullName();
+                else {
+                    const firstRequestToTest = requestsForGroup.find((request) => !!request.test());
+                    testName = `Building (for ${firstRequestToTest.test().fullName()})`;
+                }
                 return element('tr', [
                     element('td', {class: 'request-id'}, request.id()),
                     element('td', {class: 'platform'}, request.platform().name()),
-                    element('td', {class: 'test'}, request.test().fullName()),
+                    element('td', {class: 'test'}, testName),
                     element('td', {class: 'task'}, !task ? taskId : link(task.name(), router.url(`analysis/task/${task.id()}`))),
                     element('td', {class: 'test-group'}, request.testGroupId()),
-                    element('td', {class: 'order'}, `${request.order() + 1} of ${requestCountForGroup[request.testGroupId()]}`),
+                    element('td', {class: 'order'}, `${request.order() - firstOrder + 1} of ${requestCountForGroup[request.testGroupId()]}`),
                     element('td', {class: 'status'}, request.statusLabel()),
                     element('td', {class: 'wait'}, request.waitingTime(referenceTime))]);
             }))]);