예제 #1
0
    def test_get_failing_results_dict_webdriver_failing_results_(self):
        host = self.mock_host()
        host.results_fetcher.set_results(
            Build('MOCK Try Trusty', 123),
            WebTestResults({
                'tests': {
                    'external': {
                        'wpt': {
                            'x': {
                                'failing-test.html': {
                                    'expected': 'PASS',
                                    'actual': 'IMAGE',
                                    'is_unexpected': True,
                                },
                            },
                        },
                    },
                },
            }))

        host.results_fetcher.set_webdriver_test_results(
            Build('MOCK Try Trusty', 123), "tryserver.blink",
            WebTestResults({
                'tests': {
                    'external': {
                        'wpt': {
                            'y': {
                                'webdriver-fail.html': {
                                    'expected': 'PASS',
                                    'actual': 'FAIL',
                                    'is_unexpected': True,
                                },
                            },
                        },
                    },
                },
            }))
        updater = WPTExpectationsUpdater(host)
        results = updater.get_failing_results_dicts(
            Build('MOCK Try Trusty', 123))
        self.assertEqual(len(results), 2)
        self.assertEqual(results, [{
            'external/wpt/x/failing-test.html': {
                DesktopConfig('test-linux-trusty'):
                SimpleTestResult(
                    actual='IMAGE',
                    expected='PASS',
                    bug='crbug.com/626703',
                ),
            }
        }, {
            'external/wpt/y/webdriver-fail.html': {
                DesktopConfig('test-linux-trusty'):
                SimpleTestResult(
                    actual='FAIL',
                    expected='PASS',
                    bug='crbug.com/626703',
                ),
            },
        }])
예제 #2
0
 def test_get_failing_results_dict_no_results(self):
     host = self.mock_host()
     host.results_fetcher = MockTestResultsFetcher()
     host.results_fetcher.set_results(Build('MOCK Try Mac10.10', 123), None)
     updater = WPTExpectationsUpdater(host)
     self.assertFalse(
         updater.get_failing_results_dicts(Build('MOCK Try Mac10.10', 123)))
예제 #3
0
 def test_get_failing_results_dict_some_failing_results(self):
     host = self.mock_host()
     host.results_fetcher.set_results(
         Build('MOCK Try Mac10.10', 123),
         WebTestResults({
             'tests': {
                 'external': {
                     'wpt': {
                         'x': {
                             'failing-test.html': {
                                 'expected': 'PASS',
                                 'actual': 'IMAGE',
                                 'is_unexpected': True,
                             },
                         },
                     },
                 },
             },
         }))
     updater = WPTExpectationsUpdater(host)
     results = updater.get_failing_results_dicts(
         Build('MOCK Try Mac10.10', 123))
     self.assertEqual(results, [{
         'external/wpt/x/failing-test.html': {
             DesktopConfig(port_name='test-mac-mac10.10'):
             SimpleTestResult(
                 actual='IMAGE',
                 expected='PASS',
                 bug='crbug.com/626703',
             ),
         },
     }])
예제 #4
0
 def test_get_failing_results_dict_non_wpt_test(self):
     host = self.mock_host()
     host.results_fetcher.set_results(
         Build('MOCK Try Mac10.10', 123),
         WebTestResults({
             'tests': {
                 'x': {
                     'failing-test.html': {
                         'expected': 'PASS',
                         'actual': 'IMAGE',
                         'is_unexpected': True,
                     },
                 },
             },
         }))
     updater = WPTExpectationsUpdater(host)
     results_dict = updater.get_failing_results_dicts(
         Build('MOCK Try Mac10.10', 123))
     self.assertEqual(results_dict, [])
예제 #5
0
 def test_get_failing_results_dict_only_passing_results(self):
     host = self.mock_host()
     host.results_fetcher.set_results(
         Build('MOCK Try Mac10.10', 123),
         WebTestResults({
             'tests': {
                 'external': {
                     'wpt': {
                         'x': {
                             'passing-test.html': {
                                 'expected': 'PASS',
                                 'actual': 'PASS',
                             },
                         },
                     },
                 },
             },
         }))
     updater = WPTExpectationsUpdater(host)
     self.assertFalse(
         updater.get_failing_results_dicts(Build('MOCK Try Mac10.10', 123)))