diff options
author | simonhatch <simonhatch@chromium.org> | 2015-01-07 10:03:42 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-07 18:04:26 +0000 |
commit | 9b9256d9b947be852f236490311801f6e8d0e5eb (patch) | |
tree | 93161eb176a032ce26363db546016f640e177ca7 /build | |
parent | bbaf2c83b69fe1e0881809f2c0b7a66606d6a15a (diff) | |
download | chromium_src-9b9256d9b947be852f236490311801f6e8d0e5eb.zip chromium_src-9b9256d9b947be852f236490311801f6e8d0e5eb.tar.gz chromium_src-9b9256d9b947be852f236490311801f6e8d0e5eb.tar.bz2 |
Fix output not appearing in individual steps on android.
Previously we were returning after writing out the chartjson data before getting a chance to print out the output from the previous step.
BUG=
Review URL: https://codereview.chromium.org/822813002
Cr-Commit-Position: refs/heads/master@{#310317}
Diffstat (limited to 'build')
-rw-r--r-- | build/android/pylib/perf/test_runner.py | 15 | ||||
-rwxr-xr-x | build/android/test_runner.py | 7 |
2 files changed, 8 insertions, 14 deletions
diff --git a/build/android/pylib/perf/test_runner.py b/build/android/pylib/perf/test_runner.py index a8048d4..b7fadd2 100644 --- a/build/android/pylib/perf/test_runner.py +++ b/build/android/pylib/perf/test_runner.py @@ -75,19 +75,12 @@ def OutputJsonList(json_input, json_output): return 0 -def OutputChartjson(test_name, json_file_name): - file_name = os.path.join(constants.PERF_OUTPUT_DIR, test_name) - with file(file_name, 'r') as f: - persisted_result = pickle.load(f) - with open(json_file_name, 'w') as o: - o.write(persisted_result['chartjson']) - - -def PrintTestOutput(test_name): +def PrintTestOutput(test_name, json_file_name=None): """Helper method to print the output of previously executed test_name. Args: test_name: name of the test that has been previously executed. + json_file_name: name of the file to output chartjson data to. Returns: exit code generated by the test step. @@ -105,6 +98,10 @@ def PrintTestOutput(test_name): logging.info('*' * 80) print persisted_result['output'] + if json_file_name: + with file(json_file_name, 'w') as f: + f.write(persisted_result['chartjson']) + return persisted_result['exit_code'] diff --git a/build/android/test_runner.py b/build/android/test_runner.py index bda3405..cc00781 100755 --- a/build/android/test_runner.py +++ b/build/android/test_runner.py @@ -773,13 +773,10 @@ def _RunPerfTests(args): return perf_test_runner.OutputJsonList( perf_options.steps, perf_options.output_json_list) - if perf_options.output_chartjson_data: - return perf_test_runner.OutputChartjson( - perf_options.print_step, perf_options.output_chartjson_data) - # Just print the results from a single previously executed step. if perf_options.print_step: - return perf_test_runner.PrintTestOutput(perf_options.print_step) + return perf_test_runner.PrintTestOutput( + perf_options.print_step, perf_options.output_chartjson_data) runner_factory, tests, devices = perf_setup.Setup(perf_options) |