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

Unified Diff: ios/build/bots/scripts/test_runner.py

Issue 2619813002: [ios] Updates test_runner.py to output a test results json file. (Closed)
Patch Set: Created 3 years, 11 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 | « ios/build/bots/scripts/run.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/build/bots/scripts/test_runner.py
diff --git a/ios/build/bots/scripts/test_runner.py b/ios/build/bots/scripts/test_runner.py
index 8027d65a9e8da3d3683aabe1eeabde49b8901344..924cb2cc1111c49017899571648b66f6f14a31a1 100644
--- a/ios/build/bots/scripts/test_runner.py
+++ b/ios/build/bots/scripts/test_runner.py
@@ -178,6 +178,13 @@ class TestRunner(object):
self.xcode_version = xcode_version
self.xctest_path = ''
+ self.test_results = collections.OrderedDict()
smut 2017/01/09 21:16:12 Does order matter?
rohitrao (ping after 24h) 2017/01/09 21:32:34 Nope. I was originally trying to match what summa
+ self.test_results['version'] = 3
+ self.test_results['path_delimiter'] = '.'
+ self.test_results['seconds_since_epoch'] = int(time.time())
+ # This will be overwritten when the tests complete successfully.
+ self.test_results['interrupted'] = True
+
if xctest:
plugins_dir = os.path.join(self.app_path, 'PlugIns')
if not os.path.exists(plugins_dir):
@@ -320,6 +327,21 @@ class TestRunner(object):
else:
raise
+ # Build test_results.json
+ self.test_results['interrupted'] = result.crashed
+ self.test_results['num_failures_by_type'] = {
+ 'FAIL': len(failed) + len(flaked),
+ 'PASS': len(passed),
+ }
+ tests = collections.OrderedDict()
+ for test in passed:
+ tests[test] = { 'expected': 'PASS', 'actual': 'PASS' }
+ for test, _ in failed:
+ tests[test] = { 'expected': 'PASS', 'actual': 'FAIL' }
+ for test, _ in flaked:
+ tests[test] = { 'expected': 'PASS', 'actual': 'FAIL' }
+ self.test_results['tests'] = tests
+
self.logs['passed tests'] = passed
for test, log_lines in failed.iteritems():
self.logs[test] = log_lines
« no previous file with comments | « ios/build/bots/scripts/run.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698