- Revision
- 90120
- Author
- [email protected]
- Date
- 2011-06-30 08:30:18 -0700 (Thu, 30 Jun 2011)
Log Message
Use objects instead of strings to represent a test result in TestFailures code
This will eventually allow us to store more than just the type of failure for each test.
(E.g., we can store the name of the crashing symbol for tests which crashed.)
Prep work for <http://webkit.org/b/63465> Links to crash logs on TestFailures page should
include the crashing symbol (like links in results.html do)
Reviewed by David Kilzer.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder.js:
(Builder.prototype.failureDiagnosisTextAndURL): Changed to expect a testResult object
instead of just a failureType string.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FlakyLayoutTestDetector.js:
(FlakyLayoutTestDetector.prototype.incorporateTestResults): Changed to store a
testResult-like object for passing tests.
(FlakyLayoutTestDetector.prototype.flakinessExamples): Changed to expect testResult-like
objects.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js:
(LayoutTestResultsLoader.prototype.start): Store a version number along with the cached data
so we can throw away cached data that's in an old format. Store a testResult object for each
test instead of just its failure type.
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
(ViewController.prototype._domForFailedTest):
(ViewController.prototype._domForFailureDiagnosis):
Changed to expect testResult objects instead of failureType strings.
Modified Paths
Diff
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder.js (90119 => 90120)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder.js 2011-06-30 14:45:21 UTC (rev 90119)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder.js 2011-06-30 15:30:18 UTC (rev 90120)
@@ -34,7 +34,7 @@
return this.buildbot.buildURL(this.name, buildName);
},
- failureDiagnosisTextAndURL: function(buildName, testName, failureType) {
+ failureDiagnosisTextAndURL: function(buildName, testName, testResult) {
var urlStem = this.resultsDirectoryURL(buildName) + testName.replace(/\.[^.]+$/, '');
var diagnosticInfo = {
fail: {
@@ -54,7 +54,7 @@
},
};
- return diagnosticInfo[failureType];
+ return diagnosticInfo[testResult.failureType];
},
getMostRecentCompletedBuildNumber: function(callback) {
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FlakyLayoutTestDetector.js (90119 => 90120)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FlakyLayoutTestDetector.js 2011-06-30 14:45:21 UTC (rev 90119)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FlakyLayoutTestDetector.js 2011-06-30 15:30:18 UTC (rev 90120)
@@ -61,7 +61,7 @@
continue;
var testData = this._tests[testName];
- testData.history.push({ build: buildName, result: 'pass' });
+ testData.history.push({ build: buildName, result: { failureType: 'pass' } });
if (testData.state === this._states.LastSeenFailing)
testData.state = this._states.LastSeenPassing;
@@ -78,8 +78,8 @@
var examples = [];
for (var i = 0; i < history.length - 1; ++i) {
- var thisIsPassing = history[i].result === 'pass';
- var nextIsPassing = history[i + 1].result === 'pass';
+ var thisIsPassing = history[i].result.failureType === 'pass';
+ var nextIsPassing = history[i + 1].result.failureType === 'pass';
if (thisIsPassing === nextIsPassing)
continue;
var last = examples.last();
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js (90119 => 90120)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js 2011-06-30 14:45:21 UTC (rev 90119)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js 2011-06-30 15:30:18 UTC (rev 90120)
@@ -30,16 +30,16 @@
LayoutTestResultsLoader.prototype = {
start: function(buildName, callback, errorCallback) {
var cacheKey = 'LayoutTestResultsLoader.' + this._builder.name + '.' + buildName;
+ const currentCachedDataVersion = 1;
if (PersistentCache.contains(cacheKey)) {
var cachedData = PersistentCache.get(cacheKey);
- // Old versions of this function used to cache only the set of tests.
- if ('tooManyFailures' in cachedData) {
+ if (cachedData.version === currentCachedDataVersion) {
callback(cachedData.tests, cachedData.tooManyFailures);
return;
}
}
- var result = { tests: {}, tooManyFailures: false };
+ var result = { tests: {}, tooManyFailures: false, version: currentCachedDataVersion };
var parsedBuildName = this._builder.buildbot.parseBuildName(buildName);
@@ -70,16 +70,16 @@
}
testsForResultTable(/did not match expected results/).forEach(function(name) {
- result.tests[name] = 'fail';
+ result.tests[name] = { failureType: 'fail' };
});
testsForResultTable(/timed out/).forEach(function(name) {
- result.tests[name] = 'timeout';
+ result.tests[name] = { failureType: 'timeout' };
});
testsForResultTable(/tool to crash/).forEach(function(name) {
- result.tests[name] = 'crash';
+ result.tests[name] = { failureType: 'crash' };
});
testsForResultTable(/Web process to crash/).forEach(function(name) {
- result.tests[name] = 'webprocess crash';
+ result.tests[name] = { failureType: 'webprocess crash' };
});
PersistentCache.set(cacheKey, result);
Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js (90119 => 90120)
--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js 2011-06-30 14:45:21 UTC (rev 90119)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js 2011-06-30 15:30:18 UTC (rev 90120)
@@ -246,19 +246,19 @@
return result;
},
- _domForFailedTest: function(builder, buildName, testName, failureType) {
+ _domForFailedTest: function(builder, buildName, testName, testResult) {
var result = document.createDocumentFragment();
result.appendChild(document.createTextNode(testName));
result.appendChild(document.createTextNode(' ('));
- result.appendChild(this._domForFailureDiagnosis(builder, buildName, testName, failureType));
+ result.appendChild(this._domForFailureDiagnosis(builder, buildName, testName, testResult));
result.appendChild(document.createTextNode(')'));
return result;
},
- _domForFailureDiagnosis: function(builder, buildName, testName, failureType) {
- var diagnosticInfo = builder.failureDiagnosisTextAndURL(buildName, testName, failureType);
+ _domForFailureDiagnosis: function(builder, buildName, testName, testResult) {
+ var diagnosticInfo = builder.failureDiagnosisTextAndURL(buildName, testName, testResult);
if (!diagnosticInfo)
- return document.createTextNode(failureType);
+ return document.createTextNode(testResult.failureType);
var textNode = document.createTextNode(diagnosticInfo.text);
if (!('url' in diagnosticInfo))
Modified: trunk/Tools/ChangeLog (90119 => 90120)
--- trunk/Tools/ChangeLog 2011-06-30 14:45:21 UTC (rev 90119)
+++ trunk/Tools/ChangeLog 2011-06-30 15:30:18 UTC (rev 90120)
@@ -1,5 +1,37 @@
2011-06-30 Adam Roben <[email protected]>
+ Use objects instead of strings to represent a test result in TestFailures code
+
+ This will eventually allow us to store more than just the type of failure for each test.
+ (E.g., we can store the name of the crashing symbol for tests which crashed.)
+
+ Prep work for <http://webkit.org/b/63465> Links to crash logs on TestFailures page should
+ include the crashing symbol (like links in results.html do)
+
+ Reviewed by David Kilzer.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder.js:
+ (Builder.prototype.failureDiagnosisTextAndURL): Changed to expect a testResult object
+ instead of just a failureType string.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FlakyLayoutTestDetector.js:
+ (FlakyLayoutTestDetector.prototype.incorporateTestResults): Changed to store a
+ testResult-like object for passing tests.
+ (FlakyLayoutTestDetector.prototype.flakinessExamples): Changed to expect testResult-like
+ objects.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js:
+ (LayoutTestResultsLoader.prototype.start): Store a version number along with the cached data
+ so we can throw away cached data that's in an old format. Store a testResult object for each
+ test instead of just its failure type.
+
+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
+ (ViewController.prototype._domForFailedTest):
+ (ViewController.prototype._domForFailureDiagnosis):
+ Changed to expect testResult objects instead of failureType strings.
+
+2011-06-30 Adam Roben <[email protected]>
+
Show full commit logs when visiting Trac from TestFailures page
Fixes <http://webkit.org/b/63715> Links to Trac on TestFailures page