Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py

Issue 2277303003: In update-w3c-test-expectations, handle failure to fetch results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py
index 018ec8f571be94bb09a718fce5b1bc2ac9d503f4..77fcd0c7161665c87b414261d7d45fd1076d8d45 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations_unittest.py
@@ -5,8 +5,11 @@
import unittest
from webkitpy.common.host_mock import MockHost
+from webkitpy.common.net.buildbot import Build
+from webkitpy.common.net.buildbot_mock import MockBuildBot
+from webkitpy.common.net.layouttestresults import LayoutTestResult, LayoutTestResults
from webkitpy.common.webkit_finder import WebKitFinder
-from webkitpy.common.net.layouttestresults import LayoutTestResult
+from webkitpy.layout_tests.builder_list import BuilderList
from webkitpy.w3c.update_w3c_test_expectations import W3CExpectationsLineAdder
@@ -36,6 +39,59 @@ class UpdateW3CTestExpectationsTest(unittest.TestCase, W3CExpectationsLineAdder)
'one': {'expected': 'FAIL', 'actual': 'TIMEOUT', 'bug': 'crbug.com/626703'}
}
}
+ self.host.builders = BuilderList({
+ 'mac': {'port_name': 'test-mac'},
+ })
+
+ def tearDown(self):
+ self.host = None
+
+ def test_get_failing_results_dict_only_passing_results(self):
+ self.host.buildbot.set_results(Build('mac', 123), LayoutTestResults({
+ 'tests': {
+ 'fake': {
+ 'test.html': {
+ 'passing-test.html': {
+ 'expected': 'PASS',
+ 'actual': 'PASS',
+ },
+ },
+ },
+ },
+ }))
+ line_adder = W3CExpectationsLineAdder(self.host)
+ self.assertEqual(line_adder.get_failing_results_dict(self.host.buildbot, 'mac', 123), {})
+
+ def test_get_failing_results_dict_no_results(self):
+ self.host.buildbot = MockBuildBot()
+ self.host.buildbot.set_results(Build('mac', 123), None)
+ line_adder = W3CExpectationsLineAdder(self.host)
+ self.assertEqual(line_adder.get_failing_results_dict(self.host.buildbot, 'mac', 123), {})
+
+ def test_get_failing_results_dict_some_failing_results(self):
+ self.host.buildbot.set_results(Build('mac', 123), LayoutTestResults({
+ 'tests': {
+ 'fake': {
+ 'test.html': {
+ 'failing-test.html': {
+ 'expected': 'PASS',
+ 'actual': 'IMAGE',
+ 'is_unexpected': True,
+ },
+ },
+ },
+ },
+ }))
+ line_adder = W3CExpectationsLineAdder(self.host)
+ self.assertEqual(line_adder.get_failing_results_dict(self.host.buildbot, 'mac', 123), {
+ 'fake/test.html/failing-test.html': {
+ 'Mac': {
+ 'actual': 'IMAGE',
+ 'expected': 'PASS',
+ 'bug': 'crbug.com/626703',
+ },
+ },
+ })
def test_merge_same_valued_keys(self):
self.assertEqual(
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/update_w3c_test_expectations.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698