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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py

Issue 2813173002: webkitpy: Rework the JSON output flags. (Closed)
Patch Set: Fixing for review. Created 3 years, 8 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/layout_tests/run_webkit_tests.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/layout_tests/run_webkit_tests_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
index 76f8050cb163091b74fa42e404cebc7de9da86fc..7e1af3c44901e03d429ec577e1e07e7841b7ae48 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -170,7 +170,7 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
def test_basic(self):
options, args = parse_args(
- extra_args=['--json-test-results', '/tmp/json_test_results.json'],
+ extra_args=['--json-failing-test-results', '/tmp/json_failing_test_results.json'],
tests_included=True)
logging_stream = StringIO.StringIO()
stdout = StringIO.StringIO()
@@ -210,9 +210,6 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
json_to_eval = failing_results_text.replace('ADD_RESULTS(', '').replace(');', '')
self.assertEqual(json.loads(json_to_eval), details.summarized_failing_results)
- json_test_results = host.filesystem.read_text_file('/tmp/json_test_results.json')
- self.assertEqual(json.loads(json_test_results), details.summarized_failing_results)
-
full_results_text = host.filesystem.read_text_file('/tmp/layout-test-results/full_results.json')
self.assertEqual(json.loads(full_results_text), details.summarized_full_results)
@@ -1007,12 +1004,38 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
tests_included=True, host=host)
self.assertIn('OUT:', err.getvalue())
- def test_write_full_results_to(self):
+ def _check_json_test_results(self, host, details):
+ self.assertEqual(details.exit_code, 0)
+ self.assertTrue(host.filesystem.exists('/tmp/json_results.json'))
+ json_failing_test_results = host.filesystem.read_text_file('/tmp/json_results.json')
+ self.assertEqual(json.loads(json_failing_test_results), details.summarized_full_results)
+
+ def test_json_test_results(self):
+ host = MockHost()
+ details, _, _ = logging_run(
+ ['--json-test-results', '/tmp/json_results.json'], host=host)
+ self._check_json_test_results(host, details)
+
+ def test_json_test_results_alias_write_full_results_to(self):
+ host = MockHost()
+ details, _, _ = logging_run(
+ ['--write-full-results-to', '/tmp/json_results.json'], host=host)
+ self._check_json_test_results(host, details)
+
+ def test_json_test_results_alias_isolated_script_test_output(self):
+ host = MockHost()
+ details, _, _ = logging_run(
+ ['--isolated-script-test-output', '/tmp/json_results.json'], host=host)
+ self._check_json_test_results(host, details)
+
+ def test_json_failing_test_results(self):
host = MockHost()
- details, _, _ = logging_run(['--write-full-results-to', '/tmp/full_results.json',
- '--order', 'natural'], host=host)
+ details, _, _ = logging_run(
+ ['--json-failing-test-results', '/tmp/json_failing_results.json'], host=host)
self.assertEqual(details.exit_code, 0)
- self.assertTrue(host.filesystem.exists('/tmp/full_results.json'))
+ self.assertTrue(host.filesystem.exists('/tmp/json_failing_results.json'))
+ json_failing_test_results = host.filesystem.read_text_file('/tmp/json_failing_results.json')
+ self.assertEqual(json.loads(json_failing_test_results), details.summarized_failing_results)
def test_buildbot_results_are_printed_on_early_exit(self):
stdout = StringIO.StringIO()
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698