Chromium Code Reviews| Index: testing/scripts/run_telemetry_benchmark_as_googletest.py |
| diff --git a/testing/scripts/run_telemetry_benchmark_as_googletest.py b/testing/scripts/run_telemetry_benchmark_as_googletest.py |
| index 387c5c8da95993f984f20522253b471eca93a58d..dcf2e72239d7acce4118f85aa949283b2d94e786 100755 |
| --- a/testing/scripts/run_telemetry_benchmark_as_googletest.py |
| +++ b/testing/scripts/run_telemetry_benchmark_as_googletest.py |
| @@ -18,7 +18,7 @@ This script is intended to be the base command invoked by the isolate, |
| followed by a subsequent Python script. It could be generalized to |
| invoke an arbitrary executable. |
| """ |
| - |
| +import logging |
| import argparse |
| import json |
| import os |
| @@ -40,12 +40,14 @@ CHROME_SANDBOX_ENV = 'CHROME_DEVEL_SANDBOX' |
| CHROME_SANDBOX_PATH = '/opt/chromium/chrome_sandbox' |
| def main(): |
| + logging.info("1: IN THE SCRIPT") |
|
dtu
2016/09/01 05:18:38
Are these intentional?
eyaich1
2016/09/01 14:19:35
lol definitely not. this file sholdn't be include
|
| parser = argparse.ArgumentParser() |
| parser.add_argument( |
| '--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() |
| + logging.info("2: PARSED ARGS") |
| xvfb_proc = None |
| openbox_proc = None |
| xcompmgr_proc = None |
| @@ -58,18 +60,22 @@ def main(): |
| xvfb_proc, openbox_proc, xcompmgr_proc = xvfb.start_xvfb(env=env, |
| build_dir='.') |
| assert xvfb_proc and openbox_proc and xcompmgr_proc, 'Failed to start xvfb' |
| + logging.info("3: ABOUT TO TRY") |
| try: |
| tempfile_dir = tempfile.mkdtemp('telemetry') |
| valid = True |
| failures = [] |
| try: |
| + logging.info("4: TRY AGAIN") |
| rc = common.run_command([sys.executable] + rest_args + [ |
| '--output-dir', tempfile_dir, |
| '--output-format=json' |
| ], env=env) |
| + logging.info("5: AFTER COMMAND") |
| tempfile_name = os.path.join(tempfile_dir, 'results.json') |
| with open(tempfile_name) as f: |
| results = json.load(f) |
| + logging.info("6: ABOUT TO WRITE RESULTS") |
| for value in results['per_page_values']: |
| if value['type'] == 'failure': |
| failures.append(results['pages'][str(value['page_id'])]['name']) |
| @@ -85,6 +91,7 @@ def main(): |
| if rc == 0: |
| rc = 1 # Signal an abnormal exit. |
| + logging.info("7: ABOUT TO DUMP") |
| json.dump({ |
| 'valid': valid, |
| 'failures': failures, |