Changeset 90120 in webkit


Ignore:
Timestamp:
Jun 30, 2011, 8:30:18 AM (14 years ago)
Author:
Adam Roben
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.

Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder.js

    r89840 r90120  
    3535    },
    3636
    37     failureDiagnosisTextAndURL: function(buildName, testName, failureType) {
     37    failureDiagnosisTextAndURL: function(buildName, testName, testResult) {
    3838        var urlStem = this.resultsDirectoryURL(buildName) + testName.replace(/\.[^.]+$/, '');
    3939        var diagnosticInfo = {
     
    5555        };
    5656
    57         return diagnosticInfo[failureType];
     57        return diagnosticInfo[testResult.failureType];
    5858    },
    5959
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FlakyLayoutTestDetector.js

    r90054 r90120  
    6262
    6363            var testData = this._tests[testName];
    64             testData.history.push({ build: buildName, result: 'pass' });
     64            testData.history.push({ build: buildName, result: { failureType: 'pass' } });
    6565
    6666            if (testData.state === this._states.LastSeenFailing)
     
    7979        var examples = [];
    8080        for (var i = 0; i < history.length - 1; ++i) {
    81             var thisIsPassing = history[i].result === 'pass';
    82             var nextIsPassing = history[i + 1].result === 'pass';
     81            var thisIsPassing = history[i].result.failureType === 'pass';
     82            var nextIsPassing = history[i + 1].result.failureType === 'pass';
    8383            if (thisIsPassing === nextIsPassing)
    8484                continue;
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js

    r89841 r90120  
    3131    start: function(buildName, callback, errorCallback) {
    3232        var cacheKey = 'LayoutTestResultsLoader.' + this._builder.name + '.' + buildName;
     33        const currentCachedDataVersion = 1;
    3334        if (PersistentCache.contains(cacheKey)) {
    3435            var cachedData = PersistentCache.get(cacheKey);
    35             // Old versions of this function used to cache only the set of tests.
    36             if ('tooManyFailures' in cachedData) {
     36            if (cachedData.version === currentCachedDataVersion) {
    3737                callback(cachedData.tests, cachedData.tooManyFailures);
    3838                return;
     
    4040        }
    4141
    42         var result = { tests: {}, tooManyFailures: false };
     42        var result = { tests: {}, tooManyFailures: false, version: currentCachedDataVersion };
    4343
    4444        var parsedBuildName = this._builder.buildbot.parseBuildName(buildName);
     
    7171
    7272                testsForResultTable(/did not match expected results/).forEach(function(name) {
    73                     result.tests[name] = 'fail';
     73                    result.tests[name] = { failureType: 'fail' };
    7474                });
    7575                testsForResultTable(/timed out/).forEach(function(name) {
    76                     result.tests[name] = 'timeout';
     76                    result.tests[name] = { failureType: 'timeout' };
    7777                });
    7878                testsForResultTable(/tool to crash/).forEach(function(name) {
    79                     result.tests[name] = 'crash';
     79                    result.tests[name] = { failureType: 'crash' };
    8080                });
    8181                testsForResultTable(/Web process to crash/).forEach(function(name) {
    82                     result.tests[name] = 'webprocess crash';
     82                    result.tests[name] = { failureType: 'webprocess crash' };
    8383                });
    8484
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js

    r90118 r90120  
    247247    },
    248248
    249     _domForFailedTest: function(builder, buildName, testName, failureType) {
     249    _domForFailedTest: function(builder, buildName, testName, testResult) {
    250250        var result = document.createDocumentFragment();
    251251        result.appendChild(document.createTextNode(testName));
    252252        result.appendChild(document.createTextNode(' ('));
    253         result.appendChild(this._domForFailureDiagnosis(builder, buildName, testName, failureType));
     253        result.appendChild(this._domForFailureDiagnosis(builder, buildName, testName, testResult));
    254254        result.appendChild(document.createTextNode(')'));
    255255        return result;
    256256    },
    257257
    258     _domForFailureDiagnosis: function(builder, buildName, testName, failureType) {
    259         var diagnosticInfo = builder.failureDiagnosisTextAndURL(buildName, testName, failureType);
     258    _domForFailureDiagnosis: function(builder, buildName, testName, testResult) {
     259        var diagnosticInfo = builder.failureDiagnosisTextAndURL(buildName, testName, testResult);
    260260        if (!diagnosticInfo)
    261             return document.createTextNode(failureType);
     261            return document.createTextNode(testResult.failureType);
    262262
    263263        var textNode = document.createTextNode(diagnosticInfo.text);
  • trunk/Tools/ChangeLog

    r90118 r90120  
     12011-06-30  Adam Roben  <aroben@apple.com>
     2
     3        Use objects instead of strings to represent a test result in TestFailures code
     4
     5        This will eventually allow us to store more than just the type of failure for each test.
     6        (E.g., we can store the name of the crashing symbol for tests which crashed.)
     7
     8        Prep work for <http://webkit.org/b/63465> Links to crash logs on TestFailures page should
     9        include the crashing symbol (like links in results.html do)
     10
     11        Reviewed by David Kilzer.
     12
     13        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Builder.js:
     14        (Builder.prototype.failureDiagnosisTextAndURL): Changed to expect a testResult object
     15        instead of just a failureType string.
     16
     17        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FlakyLayoutTestDetector.js:
     18        (FlakyLayoutTestDetector.prototype.incorporateTestResults): Changed to store a
     19        testResult-like object for passing tests.
     20        (FlakyLayoutTestDetector.prototype.flakinessExamples): Changed to expect testResult-like
     21        objects.
     22
     23        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js:
     24        (LayoutTestResultsLoader.prototype.start): Store a version number along with the cached data
     25        so we can throw away cached data that's in an old format. Store a testResult object for each
     26        test instead of just its failure type.
     27
     28        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
     29        (ViewController.prototype._domForFailedTest):
     30        (ViewController.prototype._domForFailureDiagnosis):
     31        Changed to expect testResult objects instead of failureType strings.
     32
    1332011-06-30  Adam Roben  <aroben@apple.com>
    234
Note: See TracChangeset for help on using the changeset viewer.