Index: build/android/pylib/results/presentation/test_results_presentation.py |
diff --git a/build/android/pylib/results/presentation/test_results_presentation.py b/build/android/pylib/results/presentation/test_results_presentation.py |
index d7e2b5a300ae13e292647270d54562990dd91462..ef5ab558b31dd66a1d94b118c4dee0283edfaa6a 100755 |
--- a/build/android/pylib/results/presentation/test_results_presentation.py |
+++ b/build/android/pylib/results/presentation/test_results_presentation.py |
@@ -306,6 +306,7 @@ def upload_to_google_bucket(html, test_name, builder_name, build_number, |
return '%s/%s/%s' % (server_url, bucket, dest) |
+ |
def main(): |
parser = argparse.ArgumentParser() |
parser.add_argument('--json-file', help='Path of json file.') |
@@ -347,16 +348,22 @@ def main(): |
if ((args.build_properties is None) == |
(args.build_number is None or args.builder_name is None)): |
raise parser.error('Exactly one of build_perperties or ' |
- '(build_number or builder_names) should be given.') |
+ '(build_number or builder_name) should be given.') |
if (args.build_number is None) != (args.builder_name is None): |
raise parser.error('args.build_number and args.builder_name ' |
- 'has to be be given together' |
- 'or not given at all.') |
+ 'has to be be given together' |
+ 'or not given at all.') |
if (len(args.positional) == 0) == (args.json_file is None): |
- raise parser.error('Exactly one of args.positional and ' |
- 'args.json_file should be given.') |
+ if args.json_file: |
jbudorick
2017/04/27 18:40:37
Given that you're handling the two cases different
BigBossZhiling
2017/04/27 20:41:49
Done.
|
+ raise parser.error('Exactly one of args.positional and ' |
+ 'args.json_file should be given.') |
+ else: |
+ if args.output_json: |
+ with open(args.output_json, 'w') as f: |
+ f.write('{}') |
jbudorick
2017/04/27 18:40:37
nit: json.dump({}, f)
I know the result is the sa
BigBossZhiling
2017/04/27 20:41:49
Done.
|
+ return |
if args.build_properties: |
build_properties = json.loads(args.build_properties) |