OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import collections | 6 import collections |
7 import glob | 7 import glob |
8 import hashlib | 8 import hashlib |
9 import multiprocessing | 9 import multiprocessing |
10 import os | 10 import os |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 The directory at path should ostensibly contain HTML coverage data. | 307 The directory at path should ostensibly contain HTML coverage data. |
308 | 308 |
309 Args: | 309 Args: |
310 options: Command line options. | 310 options: Command line options. |
311 path: Path to the directory to be uploaded. | 311 path: Path to the directory to be uploaded. |
312 coverage_type: String used as the first component of the url. | 312 coverage_type: String used as the first component of the url. |
313 | 313 |
314 Returns: | 314 Returns: |
315 None. | 315 None. |
316 """ | 316 """ |
317 revision = options.build_properties.get('got_revision', 'testing') | 317 revision = options.build_properties.get('got_revision') |
| 318 if not revision: |
| 319 revision = options.build_properties.get('revision', 'testing') |
318 bot_id = options.build_properties.get('buildername', 'testing') | 320 bot_id = options.build_properties.get('buildername', 'testing') |
319 randhash = hashlib.sha1(str(random.random())).hexdigest() | 321 randhash = hashlib.sha1(str(random.random())).hexdigest() |
320 gs_path = '%s/%s/%s/%s/%s' % (options.coverage_bucket, coverage_type, | 322 gs_path = '%s/%s/%s/%s/%s' % (options.coverage_bucket, coverage_type, |
321 bot_id, revision, randhash) | 323 bot_id, revision, randhash) |
322 | 324 |
323 RunCmd([bb_utils.GSUTIL_PATH, 'cp', '-R', path, 'gs://%s' % gs_path]) | 325 RunCmd([bb_utils.GSUTIL_PATH, 'cp', '-R', path, 'gs://%s' % gs_path]) |
324 bb_annotations.PrintLink( | 326 bb_annotations.PrintLink( |
325 'Coverage report', | 327 'Coverage report', |
326 'https://storage.googleapis.com/%s/index.html' % gs_path) | 328 'https://storage.googleapis.com/%s/index.html' % gs_path) |
327 | 329 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 434 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
433 if options.coverage_bucket: | 435 if options.coverage_bucket: |
434 setattr(options, 'coverage_dir', | 436 setattr(options, 'coverage_dir', |
435 os.path.join(CHROME_SRC, 'out', options.target, 'coverage')) | 437 os.path.join(CHROME_SRC, 'out', options.target, 'coverage')) |
436 | 438 |
437 MainTestWrapper(options) | 439 MainTestWrapper(options) |
438 | 440 |
439 | 441 |
440 if __name__ == '__main__': | 442 if __name__ == '__main__': |
441 sys.exit(main(sys.argv)) | 443 sys.exit(main(sys.argv)) |
OLD | NEW |