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

Unified Diff: testing/scripts/run_telemetry_as_googletest.py

Issue 2408043002: Revert of [testing/script] Switch run_telemetry_as_googletest.py to produce full json results format (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/scripts/run_telemetry_as_googletest.py
diff --git a/testing/scripts/run_telemetry_as_googletest.py b/testing/scripts/run_telemetry_as_googletest.py
index db489b8156a224a02f9b9203c70fde80dbf8f33b..82491845dc6273f5cfd88b806b7eccb104583fae 100755
--- a/testing/scripts/run_telemetry_as_googletest.py
+++ b/testing/scripts/run_telemetry_as_googletest.py
@@ -35,7 +35,7 @@
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
- '--isolated-script-test-output', type=str,
+ '--isolated-script-test-output', type=argparse.FileType('w'),
required=True)
parser.add_argument('--xvfb', help='Start xvfb.', action='store_true')
args, rest_args = parser.parse_known_args()
@@ -72,8 +72,23 @@
'--shard-index=%d' % shard_index
]
try:
- return common.run_command([sys.executable] + rest_args + sharding_args + [
- '--write-full-results-to', args.isolated_script_test_output], env=env)
+ with common.temporary_file() as tempfile_path:
+ rc = common.run_command([sys.executable] + rest_args + sharding_args + [
+ '--write-full-results-to', tempfile_path,
+ ], env=env)
+ with open(tempfile_path) as f:
+ results = json.load(f)
+ parsed_results = common.parse_common_test_results(results,
+ test_separator='.')
+ failures = parsed_results['unexpected_failures']
+
+ json.dump({
+ 'valid': bool(rc <= common.MAX_FAILURES_EXIT_STATUS and
+ ((rc == 0) or failures)),
+ 'failures': failures.keys(),
+ }, args.isolated_script_test_output)
+
+ return rc
finally:
xvfb.kill(xvfb_proc)
xvfb.kill(openbox_proc)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698