- Revision
- 89588
- Author
- [email protected]
- Date
- 2011-06-23 10:44:26 -0700 (Thu, 23 Jun 2011)
Log Message
Make finding existing bugs and filing new bugs work on TestFailures even when lots of tests are failing
One bug this fixes is <http://webkit.org/b/61660> New bug links on TestFailures page often
contain titles that are so long they are rejected by Bugzilla
Reviewed by David Kilzer.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Bugzilla.js:
(Bugzilla.prototype.quickSearch): Use fetchResource to POST the search query rather than
using a query string on the URL. If the search query is very long, using a query string can
cause the request to be rejected due to the URL being too long. POSTing avoids this issue.
(Bugzilla.maximumBugTitleLength): Added this constant based on Bugzilla's implementation.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestFailures.css:
(.new-bug-form): Hide the form that we secretly use to file a new bug.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js:
(fetchResource): Added. Code came from getResource. If we're using a GET request, add the
query parameters to the URL. Otherwise, send them as the body of the request along with the
appropriate headers.
(getResource): Now just calls through to fetchResource.
(urlEncodedQueryParameters): Added. Moved some code here...
(addQueryParametersToURL): ...from here.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
(ViewController.prototype._domForNewAndExistingBugs): Shorten the title to just mention the
number of failing tests if mentioning all the tests would make the title too long. Improved
the description for large numbers of failures by listing the tests one-per-line instead of
just having them be comma-separated, which was hard to read. Use a form to file the new bug
instead of a link so that we can POST the form data. (Using a URL with a query string can
result in the URL being too long.) The new bug link now just submits the form.
Modified Paths
Diff
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Bugzilla.js (89587 => 89588)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Bugzilla.js 2011-06-23 17:42:16 UTC (rev 89587)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Bugzilla.js 2011-06-23 17:44:26 UTC (rev 89588)
@@ -51,7 +51,7 @@
};
var self = this;
- getResource(addQueryParametersToURL(this.baseURL + 'buglist.cgi', queryParameters), function(xhr) {
+ fetchResource(this.baseURL + 'buglist.cgi', 'POST', queryParameters, function(xhr) {
var entries = xhr.responseXML.getElementsByTagName('entry');
var results = Array.prototype.map.call(entries, function(entry) {
var container = document.createElement('div');
@@ -86,3 +86,6 @@
};
return status in openStatuses;
};
+
+// This value is built-in to all Bugzilla installations. See <http://webkit.org/b/61660>.
+Bugzilla.maximumBugTitleLength = 255;
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestFailures.css (89587 => 89588)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestFailures.css 2011-06-23 17:42:16 UTC (rev 89587)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestFailures.css 2011-06-23 17:44:26 UTC (rev 89588)
@@ -39,3 +39,7 @@
.existing-bugs-list {
font-size: smaller;
}
+
+.new-bug-form {
+ display: none;
+}
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js (89587 => 89588)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js 2011-06-23 17:42:16 UTC (rev 89587)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js 2011-06-23 17:44:26 UTC (rev 89588)
@@ -36,7 +36,7 @@
return list;
}
-function getResource(url, callback, errorCallback) {
+function fetchResource(url, method, queryParameters, callback, errorCallback) {
var xhr = new XMLHttpRequest();
xhr._onreadystatechange_ = function() {
if (this.readyState !== 4)
@@ -47,21 +47,42 @@
else if (errorCallback)
errorCallback(this);
};
- xhr.open("GET", url);
- xhr.send();
+
+ if (method === 'GET' && queryParameters)
+ url = "" queryParameters);
+
+ xhr.open(method, url);
+
+ if (method === 'GET') {
+ xhr.send();
+ return;
+ }
+
+ var data = ""
+ xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+ xhr.setRequestHeader('Content-Length', data.length);
+ xhr.setRequestHeader('Connection', 'close');
+ xhr.send(data);
}
-function addQueryParametersToURL(url, queryParameters) {
+function getResource(url, callback, errorCallback) {
+ fetchResource(url, 'GET', null, callback, errorCallback);
+}
+
+function urlEncodeQueryParameters(queryParameters) {
var encodedParameters = Object.keys(queryParameters).map(function(key) {
return key + '=' + encodeURIComponent(queryParameters[key]);
});
+ return encodedParameters.join('&');
+}
+function addQueryParametersToURL(url, queryParameters) {
if (url.indexOf('?') < 0)
url += '?';
else
url += '&';
- return url + encodedParameters.join('&');
+ return url + urlEncodeQueryParameters(queryParameters);
}
Array.prototype.findFirst = function(predicate) {
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js (89587 => 89588)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js 2011-06-23 17:42:16 UTC (rev 89587)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js 2011-06-23 17:44:26 UTC (rev 89588)
@@ -259,49 +259,81 @@
regressionRangeString = 'r' + parsedPassingBuildName.revision + '-' + regressionRangeString;
}
- var description = failingTests.join(', ')
- + (failingTests.length > 1 ? ' have' : ' has') + ' been failing on ' + tester.name
- + ' since r' + parsedFailingBuildName.revision + '.\n\n';
+ // FIXME: Some of this code should move into a new method on the Bugzilla class.
+ // FIXME: When a newly-added test has been failing since its introduction, it isn't really a
+ // "regression". We should use a different title and keywords in that case.
+ // <http://webkit.org/b/61645>
+
+ var titlePrefix = 'REGRESSION (' + regressionRangeString + '): ';
+ var titleSuffix = ' failing on ' + tester.name;
+ var title = titlePrefix + failingTests.join(', ') + titleSuffix;
+ if (title.length > Bugzilla.maximumBugTitleLength)
+ title = titlePrefix + failingTests.length + ' tests' + titleSuffix;
+ console.assert(title.length <= Bugzilla.maximumBugTitleLength);
+
+ var description;
+ if (failingTests.length === 1) {
+ description = failingTests[0] + ' has been failing on ' + tester.name
+ + ' since r' + parsedFailingBuildName.revision + '.\n\n';
+ } else if (failingTests.length === 2) {
+ description = failingTests.join(' and ') + ' have been failing on ' + tester.name
+ + ' since r' + parsedFailingBuildName.revision + '.\n\n';
+ } else {
+ description = 'The following tests have been failing on ' + tester.name
+ + ' since r' + parsedFailingBuildName.revision + ':\n\n'
+ + failingTests.map(function(test) { return ' ' + test }).join('\n')
+ + '\n\n';
+ }
if (passingBuildName)
description += encodeURI(tester.resultsPageURL(passingBuildName)) + ' passed\n';
var failingResultsHTML = tester.resultsPageURL(failingBuildName);
description += encodeURI(failingResultsHTML) + ' failed\n';
- // FIXME: Some of this code should move into a new method on the Bugzilla class.
-
- // FIXME: When a newly-added test has been failing since its introduction, it isn't really a
- // "regression". We should use a different title and keywords in that case.
- // <http://webkit.org/b/61645>
- var queryParameters = {
+ var formData = {
product: 'WebKit',
version: '528+ (Nightly build)',
component: 'Tools / Tests',
keywords: 'LayoutTestFailure, MakingBotsRed, Regression',
- short_desc: 'REGRESSION (' + regressionRangeString + '): ' + failingTests.join(', ') + ' failing on ' + tester.name,
+ short_desc: title,
comment: description,
bug_file_loc: failingResultsHTML,
};
if (/Windows/.test(tester.name)) {
- queryParameters.rep_platform = 'PC';
+ formData.rep_platform = 'PC';
if (/Windows 7/.test(tester.name))
- queryParameters.op_sys = 'Windows 7';
+ formData.op_sys = 'Windows 7';
else if (/Windows XP/.test(tester.name))
- queryParameters.op_sys = 'Windows XP';
+ formData.op_sys = 'Windows XP';
} else if (/Leopard/.test(tester.name)) {
- queryParameters.rep_platform = 'Macintosh';
+ formData.rep_platform = 'Macintosh';
if (/SnowLeopard/.test(tester.name))
- queryParameters.op_sys = 'Mac OS X 10.6';
+ formData.op_sys = 'Mac OS X 10.6';
else
- queryParameters.op_sys = 'Mac OS X 10.5';
+ formData.op_sys = 'Mac OS X 10.5';
}
+ var form = document.createElement('form');
+ result.appendChild(form);
+ form.className = 'new-bug-form';
+ form.method = 'POST';
+ form.action = "" + 'enter_bug.cgi';
+ form.target = '_blank';
+
+ for (var key in formData) {
+ var input = document.createElement('input');
+ input.type = 'hidden';
+ input.name = key;
+ input.value = formData[key];
+ form.appendChild(input);
+ }
+
var link = document.createElement('a');
container.appendChild(link);
- link.href = "" queryParameters);
- link.target = '_blank';
+ link.addEventListener('click', function(event) { form.submit(); event.preventDefault(); });
+ link.href = '';
link.appendChild(document.createTextNode('File bug for ' + (failingTests.length > 1 ? 'these failures' : 'this failure')));
return result;
Modified: trunk/Tools/ChangeLog (89587 => 89588)
--- trunk/Tools/ChangeLog 2011-06-23 17:42:16 UTC (rev 89587)
+++ trunk/Tools/ChangeLog 2011-06-23 17:44:26 UTC (rev 89588)
@@ -1,5 +1,39 @@
2011-06-23 Adam Roben <[email protected]>
+ Make finding existing bugs and filing new bugs work on TestFailures even when lots of tests are failing
+
+ One bug this fixes is <http://webkit.org/b/61660> New bug links on TestFailures page often
+ contain titles that are so long they are rejected by Bugzilla
+
+ Reviewed by David Kilzer.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Bugzilla.js:
+ (Bugzilla.prototype.quickSearch): Use fetchResource to POST the search query rather than
+ using a query string on the URL. If the search query is very long, using a query string can
+ cause the request to be rejected due to the URL being too long. POSTing avoids this issue.
+ (Bugzilla.maximumBugTitleLength): Added this constant based on Bugzilla's implementation.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestFailures.css:
+ (.new-bug-form): Hide the form that we secretly use to file a new bug.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js:
+ (fetchResource): Added. Code came from getResource. If we're using a GET request, add the
+ query parameters to the URL. Otherwise, send them as the body of the request along with the
+ appropriate headers.
+ (getResource): Now just calls through to fetchResource.
+ (urlEncodedQueryParameters): Added. Moved some code here...
+ (addQueryParametersToURL): ...from here.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
+ (ViewController.prototype._domForNewAndExistingBugs): Shorten the title to just mention the
+ number of failing tests if mentioning all the tests would make the title too long. Improved
+ the description for large numbers of failures by listing the tests one-per-line instead of
+ just having them be comma-separated, which was hard to read. Use a form to file the new bug
+ instead of a link so that we can POST the form data. (Using a URL with a query string can
+ result in the URL being too long.) The new bug link now just submits the form.
+
+2011-06-23 Adam Roben <[email protected]>
+
Show closed bugs on the TestFailures page in addition to open ones
Fixes <http://webkit.org/b/63194> TestFailures page should show closed bugs, too