+2013-10-23 Ryosuke Niwa <rniwa@webkit.org>
+
+ Clicking on a test name on the new flakiness dashboard should add a new test pane
+ https://bugs.webkit.org/show_bug.cgi?id=123194
+
+ Reviewed by Simon Fraser.
+
+ Added a new click handler on each test name inside the builder test view add a new test pane.
+ Moved the old trac link to a right-arrow inline SVG icon.
+
+ Also tweaked the style so that the builder test view looks different from other test panes.
+
+ * index.html:
+ (TestResultsView._urlFromTest): Extracted from TestResultsView._linkifiedTestName.
+ (TestResultsView._populateBuilderPane): Fetch the test when its name is clicked.
+ Added a circled right arrow for the old trac link.
+ * main.css: Tweaked the style to move the rounded border around the builder test view to be
+ around the form controls to clearly differentiate it from a regular test pane.
+
2013-10-22 Ryosuke Niwa <rniwa@webkit.org>
New flakiness dashboard's test pane should show the latest WebKit revision for each builder
placeholder="Type in a test name, or copy and paste test names on results.html or NRWT stdout (including junks)"></form>
<div id="testView"></div>
+<div id="buildersView">
<form>
Show
<label>tests <select id="builderFailureTypeView"><option>failing</option><option>flaky</option><option value="wrongexpectations">has wrong expectations</option></select></label>
<label for="builderDaysView">in the last <select id="builderDaysView"><option>5</option><option>15</option><option>30</option></select> days</label>
</form>
<div id="builderFailingTestsView"></div>
+</div>
<div id="tooltipContainer"></div>
$(table).tablesorter();
}
-TestResultsView._linkifiedTestName = function (test) {
+TestResultsView._urlFromTest = function (test) {
var category = this._testCategories[test.category];
if (!category)
- return test.name;
+ return null;
+ return category.url.replace(/\$testName/g, test.name);
+}
- return element('a', {'href': category.url.replace(/\$testName/g, test.name)}, [test.name]);
+TestResultsView._linkifiedTestName = function (test) {
+ var url = this._urlFromTest(test);
+ return url ? element('a', {'href': url}, [test.name]) : test.name;
}
TestResultsView._createTestResultHeader = function (labelForFirstColumn, repositories) {
}
TestResultsView._matchesFailureType = function (results, failureType, tn) {
+ return true;
if (!results.length)
return false;
var latestActualResult = results[0].actual;
var tbody = element('tbody');
var builder = this._builders[builderId];
+ var self = this;
for (var testId in resultsByTests) {
var results = resultsByTests[testId];
if (!results.length || !this._matchesFailureType(results, failureType, this._availableTests[testId].name))
continue;
this._createBuildsAndComputeSlownessOfResults(builderId, resultsByTests[testId]);
- tbody.appendChild(this._createTestResultRow(this._linkifiedTestName(this._availableTests[testId]), resultsByTests[testId], builder));
+ var test = this._availableTests[testId];
+ var externalTestLink = element('a', {'class': 'externalTestLink', 'href': this._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));
}
table.appendChild(tbody);
var self = this;
var xhr = new XMLHttpRequest();
- xhr.open("GET", 'api/failing-tests.php?builder=' + escape(builderName) + '&days=' + numberOfDays, true);
+ xhr.open("GET", 'api/failing-tests.php?builder=' + escape(builderName) + '&days=' + numberOfDays + '&failureType=' + failureType, true);
xhr.onload = function(event) {
var response = JSON.parse(xhr.response);
section.innerHTML = '';
xhr.send();
}
-TestResultsView.updateLocationHash = function () {
+TestResultsView._createLocationHash = function (tests) {
var params = {
- 'tests': this._tests.join(','),
+ 'tests': tests.join(','),
'builder': this._currentBuilder,
'builderFailureType': this._currentBuilderFailureType,
'builderDays': this._currentBuilderDays,
continue;
hash += '&' + decodeURIComponent(key) + '=' + decodeURIComponent(value);
}
- location.hash = hash;
+ return hash;
+}
+
+TestResultsView.updateLocationHash = function () {
+ location.hash = this._createLocationHash(this._tests);
this._oldHash = location.hash;
}