| Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_test_expectations_unittest.py
|
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_test_expectations_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_test_expectations_unittest.py
|
| index 58559780c221a40332f8c413aa4e15c3b2265bf7..b936f5041d9a9a3db67272aa3915dc342b7a491b 100644
|
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_test_expectations_unittest.py
|
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_test_expectations_unittest.py
|
| @@ -37,20 +37,20 @@ class FakeBotTestExpectationsFactory(object):
|
|
|
| For example, if the bot results for mytest.html are:
|
| PASS PASS FAIL PASS TIMEOUT
|
| - then _all_results_by_builder would be:
|
| + then |all_results_by_builder| would be:
|
| {
|
| 'WebKit Linux Trusty' : {
|
| 'mytest.html': ['FAIL', 'PASS', 'TIMEOUT']
|
| }
|
| }
|
| """
|
| - self._all_results_by_builder = {}
|
| + self.all_results_by_builder = {}
|
|
|
| def expectations_for_builder(self, builder):
|
| - if builder not in self._all_results_by_builder:
|
| + if builder not in self.all_results_by_builder:
|
| return None
|
|
|
| - return FakeBotTestExpectations(self._all_results_by_builder[builder])
|
| + return FakeBotTestExpectations(self.all_results_by_builder[builder])
|
|
|
|
|
| class FakePortFactory(PortFactory):
|
| @@ -180,7 +180,38 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| self._port.all_systems = (('trusty', 'x86_64'),)
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| + 'WebKit Linux Trusty': {
|
| + "test/a.html": ["PASS", "PASS"],
|
| + "test/b.html": ["PASS", "PASS"],
|
| + "test/c.html": ["PASS", "PASS"],
|
| + "test/d.html": ["PASS", "PASS"],
|
| + "test/e.html": ["PASS", "PASS"],
|
| + "test/f.html": ["PASS", "PASS"],
|
| + }
|
| + }
|
| + updated_expectations = (
|
| + self._flake_remover.get_updated_test_expectations())
|
| + self._assert_expectations_match(
|
| + updated_expectations, test_expectations_before)
|
| +
|
| + def test_dont_remove_directory(self):
|
| + """Tests that lines with directories are untouched."""
|
| + test_expectations_before = """
|
| + # This expectation is for a whole directory.
|
| + Bug(test) test/ [ Failure Pass ]"""
|
| +
|
| + self._define_builders({
|
| + "WebKit Linux Trusty": {
|
| + "port_name": "linux-trusty",
|
| + "specifiers": ['Trusty', 'Release']
|
| + },
|
| + })
|
| + self._port.all_build_types = ('release',)
|
| + self._port.all_systems = (('trusty', 'x86_64'),)
|
| +
|
| + self._parse_expectations(test_expectations_before)
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS"],
|
| "test/b.html": ["PASS", "PASS"],
|
| @@ -218,7 +249,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| self._port.all_systems = (('trusty', 'x86_64'),)
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS"],
|
| "test/b.html": ["PASS", "IMAGE"],
|
| @@ -248,7 +279,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| self._port.all_systems = (('trusty', 'x86_64'),)
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS"],
|
| "test/b.html": ["PASS", "PASS"],
|
| @@ -282,7 +313,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| self._port.all_systems = (('trusty', 'x86_64'),)
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "IMAGE"],
|
| "test/b.html": ["PASS", "TEXT"],
|
| @@ -326,7 +357,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| self._port.all_systems = (('trusty', 'x86_64'),)
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| "test/b.html": ["PASS", "IMAGE", "PASS"],
|
| @@ -355,7 +386,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| self._port.all_systems = (('trusty', 'x86_64'),)
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["IMAGE", "IMAGE", "IMAGE"],
|
| }
|
| @@ -380,7 +411,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| self._port.all_systems = (('trusty', 'x86_64'),)
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| }
|
| @@ -415,7 +446,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| ('trusty', 'x86_64'))
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| "test/b.html": ["PASS", "PASS", "PASS"],
|
| @@ -467,7 +498,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| ('trusty', 'x86_64'))
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| "test/b.html": ["PASS", "PASS", "PASS"],
|
| @@ -532,7 +563,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| ('trusty', 'x86_64'))
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| "test/b.html": ["PASS", "IMAGE", "PASS"],
|
| @@ -621,7 +652,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| self._port.all_systems = (('trusty', 'x86_64'),)
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| "test/b.html": ["PASS", "PASS", "PASS"],
|
| @@ -671,7 +702,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| self._port.all_systems = (('trusty', 'x86_64'),)
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| }
|
| }
|
| @@ -731,7 +762,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| )
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| "test/b.html": ["PASS", "PASS", "PASS"],
|
| @@ -816,7 +847,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| ('trusty', 'x86_64'))
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| "test/b.html": ["PASS", "IMAGE", "PASS"],
|
| @@ -886,7 +917,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
|
|
| # Write out the fake builder bot results.
|
| expectation_factory = FakeBotTestExpectationsFactory()
|
| - expectation_factory._all_results_by_builder = {
|
| + expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| "test/b.html": ["PASS", "IMAGE", "PASS"],
|
| @@ -928,7 +959,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
|
|
| # Write out the fake builder bot results.
|
| expectation_factory = FakeBotTestExpectationsFactory()
|
| - expectation_factory._all_results_by_builder = {}
|
| + expectation_factory.all_results_by_builder = {}
|
|
|
| self.assertFalse(host.filesystem.isfile(test_expectation_path))
|
|
|
| @@ -980,7 +1011,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
|
|
| # Write out the fake builder bot results.
|
| expectation_factory = FakeBotTestExpectationsFactory()
|
| - expectation_factory._all_results_by_builder = {
|
| + expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux Trusty': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| },
|
| @@ -1019,7 +1050,7 @@ class UpdateTestExpectationsTest(LoggingTestCase):
|
| self._port.all_systems = (('trusty', 'x86_64'),)
|
|
|
| self._parse_expectations(test_expectations_before)
|
| - self._expectation_factory._all_results_by_builder = {
|
| + self._expectation_factory.all_results_by_builder = {
|
| 'WebKit Linux': {
|
| "test/a.html": ["PASS", "PASS", "PASS"],
|
| "test/b.html": ["PASS", "IMAGE", "PASS"],
|
|
|