Commit eeb15f2e authored by dglazkov@chromium.org's avatar dglazkov@chromium.org

Wire up relative time to garden-o-matic summary view.

https://bugs.webkit.org/show_bug.cgi?id=66343

Reviewed by Adam Barth.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Trac.js: Add time to the commitData object.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model_unittests.js: Adjusted unit tests.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js: Wired up relative date.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js: Updated unit tests.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/trac_unittests.js: Adjusted unit tests.

git-svn-id: svn://svn.chromium.org/blink/trunk@93241 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 61fb3cf5
...@@ -91,6 +91,7 @@ function parseCommitData(responseXML) ...@@ -91,6 +91,7 @@ function parseCommitData(responseXML)
var commits = Array.prototype.map.call(responseXML.getElementsByTagName('item'), function(item) { var commits = Array.prototype.map.call(responseXML.getElementsByTagName('item'), function(item) {
var title = item.getElementsByTagName('title')[0].textContent; var title = item.getElementsByTagName('title')[0].textContent;
var author = item.getElementsByTagName('author')[0].textContent; var author = item.getElementsByTagName('author')[0].textContent;
var time = item.getElementsByTagName('pubDate')[0].textContent;
// FIXME: This isn't a very high-fidelity reproduction of the commit message, // FIXME: This isn't a very high-fidelity reproduction of the commit message,
// but it's good enough for our purposes. // but it's good enough for our purposes.
...@@ -101,6 +102,7 @@ function parseCommitData(responseXML) ...@@ -101,6 +102,7 @@ function parseCommitData(responseXML)
return { return {
'revision': findRevision(title), 'revision': findRevision(title),
'title': title, 'title': title,
'time': time,
'summary': findSummary(message), 'summary': findSummary(message),
'author': findAuthor(message) || author, 'author': findAuthor(message) || author,
'reviewer': findReviewer(message), 'reviewer': findReviewer(message),
......
...@@ -158,6 +158,7 @@ test("updateRecentCommits", 2, function() { ...@@ -158,6 +158,7 @@ test("updateRecentCommits", 2, function() {
deepEqual(recentCommits, [{ deepEqual(recentCommits, [{
"revision": 92259, "revision": 92259,
"title": "Revision 92259: Unreviewed, rolling out r92256.\nhttp://trac.webkit.org/changeset/92256 ...", "title": "Revision 92259: Unreviewed, rolling out r92256.\nhttp://trac.webkit.org/changeset/92256 ...",
"time": "Wed, 03 Aug 2011 04:26:52 GMT",
"summary": "Unreviewed, rolling out r92256.", "summary": "Unreviewed, rolling out r92256.",
"author": "Sheriff Bot", "author": "Sheriff Bot",
"reviewer": null, "reviewer": null,
...@@ -166,6 +167,7 @@ test("updateRecentCommits", 2, function() { ...@@ -166,6 +167,7 @@ test("updateRecentCommits", 2, function() {
}, { }, {
"revision": 92256, "revision": 92256,
"title": "Revision 92256: Support cast between CSSPrimitiveValue and EBoxSizing, use in ...", "title": "Revision 92256: Support cast between CSSPrimitiveValue and EBoxSizing, use in ...",
"time": "Thu, 04 Aug 2011 02:09:19 GMT",
"summary": "Support cast between CSSPrimitiveValue and EBoxSizing, use in CSSStyleSelector.", "summary": "Support cast between CSSPrimitiveValue and EBoxSizing, use in CSSStyleSelector.",
"author": "macpherson@chromium.org", "author": "macpherson@chromium.org",
"reviewer": "Simon Fraser", "reviewer": "Simon Fraser",
......
...@@ -35,6 +35,7 @@ ui.notifications.Stream = base.extends('ol', { ...@@ -35,6 +35,7 @@ ui.notifications.Stream = base.extends('ol', {
}, },
push: function(notification) push: function(notification)
{ {
// FIXME: Add in descending time order.
this.insertBefore(notification, this.firstChild); this.insertBefore(notification, this.firstChild);
return notification; return notification;
} }
...@@ -67,11 +68,16 @@ ui.notifications.Info = base.extends(Notification, { ...@@ -67,11 +68,16 @@ ui.notifications.Info = base.extends(Notification, {
var Time = base.extends('time', { var Time = base.extends('time', {
init: function() init: function()
{ {
this.updateTime(new Date()); this.date = new Date();
}, },
updateTime: function(time) date: function()
{ {
this.textContent = base.relativizeTime(time); return this._date;
},
setDate: function(date)
{
this._date = date;
this.textContent = base.relativizeTime(date);
} }
}); });
...@@ -133,12 +139,13 @@ ui.notifications.TestFailures = base.extends(Notification, { ...@@ -133,12 +139,13 @@ ui.notifications.TestFailures = base.extends(Notification, {
{ {
if (this.containsFailureAnalysis(failureAnalysis)) if (this.containsFailureAnalysis(failureAnalysis))
return; return;
// FIXME: Retrieve date from failureAnalysis and set this._time.
// FIXME: Add in order by time.
return this._tests.appendChild(new ui.notifications.FailingTest(failureAnalysis)); return this._tests.appendChild(new ui.notifications.FailingTest(failureAnalysis));
}, },
addCommitData: function(commitData) addCommitData: function(commitData)
{ {
var commitDataDate = new Date(commitData.time);
if (this._time.date > commitDataDate);
this._time.date = commitDataDate;
return this._causes.appendChild(new ui.notifications.SuspiciousCommit(commitData)); return this._causes.appendChild(new ui.notifications.SuspiciousCommit(commitData));
} }
}); });
......
...@@ -70,8 +70,10 @@ test('ui.notifications.TestFailures', 7, function() { ...@@ -70,8 +70,10 @@ test('ui.notifications.TestFailures', 7, function() {
ok(!testFailures.containsFailureAnalysis({testName: 'foo'})); ok(!testFailures.containsFailureAnalysis({testName: 'foo'}));
testFailures.addFailureAnalysis({testName: 'test'}); testFailures.addFailureAnalysis({testName: 'test'});
equal(testFailures.innerHTML, '<time>Just now</time><div class="what"><div class="problem"><ul class="effects"><li>test</li></ul><ul class="causes"></ul></div></div>'); equal(testFailures.innerHTML, '<time>Just now</time><div class="what"><div class="problem"><ul class="effects"><li>test</li></ul><ul class="causes"></ul></div></div>');
testFailures.addCommitData({revision: 1, title: "title", author: "author", reviewer: "reviewer"}); var time = new Date();
equal(testFailures.innerHTML, '<time>Just now</time><div class="what"><div class="problem"><ul class="effects"><li>test</li></ul><ul class="causes"><li><div class="description"><a href="">1</a>title author (reviewer)</div><ul class="actions"><li><button>Roll out</button></li></ul></li></ul></div></div>'); time.setMinutes(time.getMinutes() - 10);
testFailures.addCommitData({revision: 1, time: time, title: "title", author: "author", reviewer: "reviewer"});
equal(testFailures.innerHTML, '<time>10 minutes ago</time><div class="what"><div class="problem"><ul class="effects"><li>test</li></ul><ul class="causes"><li><div class="description"><a href="">1</a>title author (reviewer)</div><ul class="actions"><li><button>Roll out</button></li></ul></li></ul></div></div>');
}); });
}()); }());
...@@ -241,6 +241,7 @@ var kExampleCommitDataXML = ...@@ -241,6 +241,7 @@ var kExampleCommitDataXML =
var kExampleCommitDataList = [{ var kExampleCommitDataList = [{
"revision": 92342, "revision": 92342,
"title": "Revision 92342: Support cast between CSSPrimitiveValue and EBoxSizing, use in ...", "title": "Revision 92342: Support cast between CSSPrimitiveValue and EBoxSizing, use in ...",
"time": "Thu, 04 Aug 2011 02:09:19 GMT",
"summary": "Support cast between CSSPrimitiveValue and EBoxSizing, use in CSSStyleSelector.", "summary": "Support cast between CSSPrimitiveValue and EBoxSizing, use in CSSStyleSelector.",
"author": "macpherson@chromium.org", "author": "macpherson@chromium.org",
"reviewer": "Simon Fraser", "reviewer": "Simon Fraser",
...@@ -249,6 +250,7 @@ var kExampleCommitDataList = [{ ...@@ -249,6 +250,7 @@ var kExampleCommitDataList = [{
}, { }, {
"revision": 92341, "revision": 92341,
"title": "Revision 92341: Implement EventSender.scalePageBy() ...", "title": "Revision 92341: Implement EventSender.scalePageBy() ...",
"time": "Thu, 04 Aug 2011 02:01:31 GMT",
"summary": "Implement EventSender.scalePageBy()", "summary": "Implement EventSender.scalePageBy()",
"author": "Kentaro Hara", "author": "Kentaro Hara",
"reviewer": "Darin Fisher", "reviewer": "Darin Fisher",
...@@ -257,6 +259,7 @@ var kExampleCommitDataList = [{ ...@@ -257,6 +259,7 @@ var kExampleCommitDataList = [{
}, { }, {
"revision": 92338, "revision": 92338,
"title": "Revision 92338: Revert an erroneous rebaseline from r92315.\n* ...", "title": "Revision 92338: Revert an erroneous rebaseline from r92315.\n* ...",
"time": "Thu, 04 Aug 2011 01:41:29 GMT",
"summary": "Revert an erroneous rebaseline from r92315.", "summary": "Revert an erroneous rebaseline from r92315.",
"author": "rniwa@webkit.org", "author": "rniwa@webkit.org",
"reviewer": null, "reviewer": null,
...@@ -265,6 +268,7 @@ var kExampleCommitDataList = [{ ...@@ -265,6 +268,7 @@ var kExampleCommitDataList = [{
}, { }, {
"revision": 92337, "revision": 92337,
"title": "Revision 92337: [Qt][Texmap][REGRESSION] http://webkit.org/blog-files/transform-style.html ...", "title": "Revision 92337: [Qt][Texmap][REGRESSION] http://webkit.org/blog-files/transform-style.html ...",
"time": "Thu, 04 Aug 2011 00:22:21 GMT",
"summary": "[Qt][Texmap][REGRESSION] http://webkit.org/blog-files/transform-style.html doesn't show composited content", "summary": "[Qt][Texmap][REGRESSION] http://webkit.org/blog-files/transform-style.html doesn't show composited content",
"author": "noam.rosenthal@nokia.com", "author": "noam.rosenthal@nokia.com",
"reviewer": "Benjamin Poulain", "reviewer": "Benjamin Poulain",
...@@ -273,6 +277,7 @@ var kExampleCommitDataList = [{ ...@@ -273,6 +277,7 @@ var kExampleCommitDataList = [{
}, { }, {
"revision": 92259, "revision": 92259,
"title": "Revision 92259: Unreviewed, rolling out r92256.\nhttp://trac.webkit.org/changeset/92256 ...", "title": "Revision 92259: Unreviewed, rolling out r92256.\nhttp://trac.webkit.org/changeset/92256 ...",
"time": "Wed, 03 Aug 2011 04:26:52 GMT",
"summary": "Unreviewed, rolling out r92256.", "summary": "Unreviewed, rolling out r92256.",
"author": "Sheriff Bot", "author": "Sheriff Bot",
"reviewer": null, "reviewer": null,
......
2011-08-16 Dimitri Glazkov <dglazkov@chromium.org>
Wire up relative time to garden-o-matic summary view.
https://bugs.webkit.org/show_bug.cgi?id=66343
Reviewed by Adam Barth.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Trac.js: Add time to the commitData object.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model_unittests.js: Adjusted unit tests.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications.js: Wired up relative date.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/notifications_unittests.js: Updated unit tests.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/trac_unittests.js: Adjusted unit tests.
2011-08-17 Adam Roben <aroben@apple.com> 2011-08-17 Adam Roben <aroben@apple.com>
Make run-api-tests run tests in alphabetical order Make run-api-tests run tests in alphabetical order
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment