24
24
25
25
def _CreateParser ():
26
26
parser = argparse .ArgumentParser ()
27
- parser .add_argument ('--perf-dashboard-machine-group' ,
28
- required = True ,
27
+ parser .add_argument ('--perf-dashboard-machine-group' , required = True ,
29
28
help = 'The "master" the bots are grouped under. This '
30
29
'string is the group in the the perf dashboard path '
31
30
'group/bot/perf_id/metric/subtest.' )
32
- parser .add_argument ('--bot' ,
33
- required = True ,
31
+ parser .add_argument ('--bot' , required = True ,
34
32
help = 'The bot running the test (e.g. '
35
- 'webrtc-win-large-tests).' )
36
- parser .add_argument (
37
- '--test-suite' ,
38
- required = True ,
39
- help = 'The key for the test in the dashboard (i.e. what '
40
- 'you select in the top-level test suite selector in the '
41
- 'dashboard' )
42
- parser .add_argument ('--webrtc-git-hash' ,
43
- required = True ,
33
+ 'webrtc-win-large-tests).' )
34
+ parser .add_argument ('--test-suite' , required = True ,
35
+ help = 'The key for the test in the dashboard (i.e. what '
36
+ 'you select in the top-level test suite selector in '
37
+ 'the dashboard' )
38
+ parser .add_argument ('--webrtc-git-hash' , required = True ,
44
39
help = 'webrtc.googlesource.com commit hash.' )
45
- parser .add_argument ('--commit-position' ,
46
- type = int ,
47
- required = True ,
40
+ parser .add_argument ('--commit-position' , type = int , required = True ,
48
41
help = 'Commit pos corresponding to the git hash.' )
49
- parser .add_argument ('--build-page-url' ,
50
- required = True ,
42
+ parser .add_argument ('--build-page-url' , required = True ,
51
43
help = 'URL to the build page for this build.' )
52
- parser .add_argument ('--dashboard-url' ,
53
- required = True ,
44
+ parser .add_argument ('--dashboard-url' , required = True ,
54
45
help = 'Which dashboard to use.' )
55
- parser .add_argument ('--input-results-file' ,
56
- type = argparse .FileType (),
46
+ parser .add_argument ('--input-results-file' , type = argparse .FileType (),
57
47
required = True ,
58
48
help = 'A JSON file with output from WebRTC tests.' )
59
- parser .add_argument ('--output-json-file' ,
60
- type = argparse .FileType ('w' ),
49
+ parser .add_argument ('--output-json-file' , type = argparse .FileType ('w' ),
61
50
help = 'Where to write the output (for debugging).' )
62
- parser .add_argument (
63
- '--outdir' ,
64
- required = True ,
65
- help = 'Path to the local out/ dir (usually out/Default)' )
51
+ parser .add_argument ('--outdir' , required = True ,
52
+ help = 'Path to the local out/ dir (usually out/Default)' )
53
+ parser .add_argument ('--wait-for-upload' , action = 'store_true' ,
54
+ help = 'If specified, script will wait untill Chrome '
55
+ 'perf dashboard confirms that the data was succesfully '
56
+ 'proccessed and uploaded' )
57
+ parser .add_argument ('--wait-timeout-sec' , type = int , default = 1200 ,
58
+ help = 'Used only if wait-for-upload is True. Maximum '
59
+ 'amount of time in seconds that the script will wait '
60
+ 'for the confirmation.' )
61
+ parser .add_argument ('--wait-polling-period-sec' , type = int , default = 120 ,
62
+ help = 'Used only if wait-for-upload is True. Status '
63
+ 'will be requested from the Dashboard every '
64
+ 'wait-polling-period-sec seconds.' )
66
65
return parser
67
66
68
67
69
68
def _ConfigurePythonPath (options ):
70
69
# We just yank the python scripts we require into the PYTHONPATH. You could
71
- # also imagine a solution where we use for instance protobuf:py_proto_runtime
72
- # to copy catapult and protobuf code to out/. This is the convention in
73
- # Chromium and WebRTC python scripts. We do need to build histogram_pb2
74
- # however, so that's why we add out/ to sys.path below.
70
+ # also imagine a solution where we use for instance
71
+ # protobuf:py_proto_runtime to copy catapult and protobuf code to out/.
72
+ # This is the convention in Chromium and WebRTC python scripts. We do need
73
+ # to build histogram_pb2 however, so that's why we add out/ to sys.path
74
+ # below.
75
75
#
76
76
# It would be better if there was an equivalent to py_binary in GN, but
77
77
# there's not.
@@ -84,8 +84,9 @@ def _ConfigurePythonPath(options):
84
84
sys .path .insert (
85
85
0 , os .path .join (checkout_root , 'third_party' , 'protobuf' , 'python' ))
86
86
87
- # The webrtc_dashboard_upload gn rule will build the protobuf stub for python,
88
- # so put it in the path for this script before we attempt to import it.
87
+ # The webrtc_dashboard_upload gn rule will build the protobuf stub for
88
+ # python, so put it in the path for this script before we attempt to import
89
+ # it.
89
90
histogram_proto_path = os .path .join (options .outdir , 'pyproto' , 'tracing' ,
90
91
'tracing' , 'proto' )
91
92
sys .path .insert (0 , histogram_proto_path )
0 commit comments