Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: third_party/gtest-parallel/gtest-parallel

Issue 2503503002: MB: Run test with gtest-parallel on swarming. (Closed)
Patch Set: Removed extra whitespace. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/mb/mb.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/gtest-parallel/gtest-parallel
diff --git a/third_party/gtest-parallel/gtest-parallel b/third_party/gtest-parallel/gtest-parallel
index 4e80928df659269eca75f169dbefc2f545c83025..22517cc1bdaf34bb413425d7ea8a67c36406781e 100755
--- a/third_party/gtest-parallel/gtest-parallel
+++ b/third_party/gtest-parallel/gtest-parallel
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -266,6 +266,15 @@ parser.add_option('--format', type='string', default='filter',
help='output format (raw,filter)')
parser.add_option('--print_test_times', action='store_true', default=False,
help='When done, list the run time of each test')
+parser.add_option('--shard-count', type='int',
pbos-webrtc 2016/11/16 17:33:09 --shard_count to match other flags
+ default=int(os.environ.get('GTEST_TOTAL_SHARDS', 1)),
+ help=('Total number of shards (for sharding test execution '
+ 'between multiple machines). Default: %default'))
+parser.add_option('--shard-index', type='int',
pbos-webrtc 2016/11/16 17:33:09 shard_index
+ default=int(os.environ.get('GTEST_SHARD_INDEX', 0)),
+ help=('Zero-indexed number identifying this shard (for '
pbos-webrtc 2016/11/16 17:33:09 Add a validator that this is <= shard-count. I thi
+ 'sharding test execution between multiple machines). '
+ 'Default: %default'))
(options, binaries) = parser.parse_args()
@@ -321,6 +330,8 @@ for test_binary in binaries:
tests.append((times.get_test_time(test_binary, test),
test_binary, test, command))
+tests = tests[options.shard_index::options.shard_count]
+
if options.failed:
# The first element of each entry is the runtime of the most recent
# run if it was successful, or None if the test is new or the most
« no previous file with comments | « no previous file | tools/mb/mb.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698