Title: [158056] trunk/Websites/test-results
Revision
158056
Author
[email protected]
Date
2013-10-25 15:01:17 -0700 (Fri, 25 Oct 2013)

Log Message

The new flakiness dashboard should sort builder and test names
https://bugs.webkit.org/show_bug.cgi?id=123363

Reviewed by Simon Fraser.

Sort builders and tests by their name in each pane.

* public/index.html:
(TestResultsView._populateTestPane): Lexicologically sort builders by their name.
(TestResultsView._sortObjectsByName): Added.
(TestResultsView._populateBuilderPane): Lexicologically sort builders by their name.

Modified Paths

Diff

Modified: trunk/Websites/test-results/ChangeLog (158055 => 158056)


--- trunk/Websites/test-results/ChangeLog	2013-10-25 21:57:40 UTC (rev 158055)
+++ trunk/Websites/test-results/ChangeLog	2013-10-25 22:01:17 UTC (rev 158056)
@@ -1,5 +1,19 @@
 2013-10-25  Ryosuke Niwa  <[email protected]>
 
+        The new flakiness dashboard should sort builder and test names
+        https://bugs.webkit.org/show_bug.cgi?id=123363
+
+        Reviewed by Simon Fraser.
+
+        Sort builders and tests by their name in each pane.
+
+        * public/index.html:
+        (TestResultsView._populateTestPane): Lexicologically sort builders by their name.
+        (TestResultsView._sortObjectsByName): Added.
+        (TestResultsView._populateBuilderPane): Lexicologically sort builders by their name.
+
+2013-10-25  Ryosuke Niwa  <[email protected]>
+
         Merge revision columns in flakiness dashboard
         https://bugs.webkit.org/show_bug.cgi?id=123360
 

Modified: trunk/Websites/test-results/public/index.html (158055 => 158056)


--- trunk/Websites/test-results/public/index.html	2013-10-25 21:57:40 UTC (rev 158055)
+++ trunk/Websites/test-results/public/index.html	2013-10-25 22:01:17 UTC (rev 158056)
@@ -184,16 +184,30 @@
     table.appendChild(this._createTestResultHeader('Builder', repositories));
 
     var tbody = element('tbody');
-    for (var builderId in resultsByBuilder) {
-        var builder = this._builders[builderId];
-        // FIXME: Add a master name if there is more than one.
-        tbody.appendChild(this._createTestResultRow(builder.name, resultsByBuilder[builderId], builder, buildTimes, repositories));
-    }
+    var builders = [];
+    for (var builderId in resultsByBuilder)
+        builders.push(this._builders[builderId]);
+
+    var self = this;
+    this._sortObjectsByName(builders).forEach(function (builder) {
+        tbody.appendChild(self._createTestResultRow(builder.name, resultsByBuilder[builder.id], builder, buildTimes, repositories));        
+    })
+
     table.appendChild(tbody);
     section.appendChild(table);
     $(table).tablesorter();
 }
 
+TestResultsView._sortObjectsByName = function (list) {
+    return list.sort(function (a, b) {
+        if (a.name < b.name)
+            return -1;
+        if (a.name > b.name)
+            return 1;
+        return 0;
+    });
+}
+
 TestResultsView._urlFromTest = function (test) {
     var category = this._testCategories[test.category];
     if (!category)
@@ -366,24 +380,27 @@
 
     table.appendChild(this._createTestResultHeader('Test'));
 
+    var tests = [];
+    for (var testId in resultsByTests)
+        tests.push(this._availableTests[testId]);
+
     var tbody = element('tbody');
     var builder = this._builders[builderId];
     var self = this;
-    for (var testId in resultsByTests) {
-        var results = resultsByTests[testId];
+    this._sortObjectsByName(tests).forEach(function (test) {
+        var results = resultsByTests[test.id];
         if (!results.length)
-            continue;
-        this._createBuildsAndComputeSlownessOfResults(builderId, resultsByTests[testId]);
-        var test = this._availableTests[testId];
-        var externalTestLink = element('a', {'class': 'externalTestLink', 'href': this._urlFromTest(test)});
+            return;
+        self._createBuildsAndComputeSlownessOfResults(builderId, results);
+        var externalTestLink = element('a', {'class': 'externalTestLink', 'href': self._urlFromTest(test)});
         var testName = element('a', {'href':'#'}, [test.name]);
         testName._onclick_ = function (event) {
             self.fetchTests([this.textContent]);
             event.preventDefault();
             return false;
         }
-        tbody.appendChild(this._createTestResultRow(element('span', [testName, externalTestLink]), resultsByTests[testId], builder));
-    }
+        tbody.appendChild(self._createTestResultRow(element('span', [testName, externalTestLink]), results, builder));
+    });
 
     table.appendChild(tbody);
     section.appendChild(table);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to