Changeset 85459 in webkit


Ignore:
Timestamp:
May 1, 2011 11:14:56 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-05-01 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

JSONTestResult needs to handle multiple results
https://bugs.webkit.org/show_bug.cgi?id=59269

This case occurs when a test is flaky because NRWT will run the test
twice and report both results as "actual."

  • Scripts/webkitpy/common/net/resultsjsonparser.py:
  • Scripts/webkitpy/common/net/resultsjsonparser_unittest.py:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r85452 r85459  
     12011-05-01  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        JSONTestResult needs to handle multiple results
     6        https://bugs.webkit.org/show_bug.cgi?id=59269
     7
     8        This case occurs when a test is flaky because NRWT will run the test
     9        twice and report both results as "actual."
     10
     11        * Scripts/webkitpy/common/net/resultsjsonparser.py:
     12        * Scripts/webkitpy/common/net/resultsjsonparser_unittest.py:
     13
    1142011-05-01  Adam Barth  <abarth@webkit.org>
    215
  • trunk/Tools/Scripts/webkitpy/common/net/resultsjsonparser.py

    r85254 r85459  
    6464
    6565    def did_pass(self):
    66         return self._actual_as_expectation() == test_expectations.PASS
     66        return test_expectations.PASS in self._actual_as_expectations()
    6767
    68     def _actual_as_expectation(self):
    69         actual_result = self._result_dict['actual']
    70         # There should always be only one expectation for actual
    71         assert(' ' not in actual_result)
    72         return test_expectations.TestExpectations.expectation_from_string(actual_result)
     68    def _actual_as_expectations(self):
     69        actual_results = self._result_dict['actual']
     70        expectations = map(test_expectations.TestExpectations.expectation_from_string, actual_results.split(' '))
     71        if None in expectations:
     72            log("Unrecognized actual result in %s" % actual_results)
     73        return expectations
    7374
    74     def _failures(self):
    75         actual = self._actual_as_expectation()
     75    def _failure_types_from_actual_result(self, actual):
    7676        # FIXME: There doesn't seem to be a full list of all possible values of
    7777        # 'actual' anywhere.  However JSONLayoutResultsGenerator.FAILURE_TO_CHAR
     
    9696            log("Failed to handle: %s" % self._result_dict['actual'])
    9797            return []
     98
     99    def _failures(self):
     100        if self.did_pass():
     101            return []
     102        return sum(map(self._failure_types_from_actual_result, self._actual_as_expectations()), [])
    98103
    99104    def test_result(self):
  • trunk/Tools/Scripts/webkitpy/common/net/resultsjsonparser_unittest.py

    r85254 r85459  
    4343                    "expected": "PASS",
    4444                    "actual": "TEXT"
     45                },
     46                "prototype-banana.html": {
     47                    "expected": "TEXT",
     48                    "actual": "PASS"
     49                },
     50                "prototype-taco.html": {
     51                    "expected": "PASS",
     52                    "actual": "PASS TEXT"
     53                },
     54                "prototype-strawberry.html": {
     55                    "expected": "PASS",
     56                    "actual": "TEXT PASS"
    4557                }
    4658            }
Note: See TracChangeset for help on using the changeset viewer.