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

Side by Side Diff: tools/sharding_supervisor/sharding_supervisor.py

Issue 10843027: Make the sharding supervisor print what commands in runs in a shard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 """Shards a given test suite and runs the shards in parallel. 6 """Shards a given test suite and runs the shards in parallel.
7 7
8 ShardingSupervisor is called to process the command line options and creates 8 ShardingSupervisor is called to process the command line options and creates
9 the specified number of worker threads. These threads then run each shard of 9 the specified number of worker threads. These threads then run each shard of
10 the test in a separate process and report on the results. When all the shards 10 the test in a separate process and report on the results. When all the shards
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 test_args = AppendToGTestOutput(gtest_args, str(index)) 175 test_args = AppendToGTestOutput(gtest_args, str(index))
176 args.extend(test_args) 176 args.extend(test_args)
177 env = os.environ.copy() 177 env = os.environ.copy()
178 env["GTEST_TOTAL_SHARDS"] = str(total_shards) 178 env["GTEST_TOTAL_SHARDS"] = str(total_shards)
179 env["GTEST_SHARD_INDEX"] = str(index) 179 env["GTEST_SHARD_INDEX"] = str(index)
180 180
181 # Use a unique log file for each shard 181 # Use a unique log file for each shard
182 # Allows ui_tests to be run in parallel on the same machine 182 # Allows ui_tests to be run in parallel on the same machine
183 env["CHROME_LOG_FILE"] = "chrome_log_%d" % index 183 env["CHROME_LOG_FILE"] = "chrome_log_%d" % index
184 184
185 sys.stderr.write('RUNNING: [%s]\n' % str(args));
186
185 return subprocess.Popen( 187 return subprocess.Popen(
186 args, stdout=stdout, 188 args, stdout=stdout,
187 stderr=stderr, 189 stderr=stderr,
188 env=env, 190 env=env,
189 bufsize=0, 191 bufsize=0,
190 universal_newlines=True) 192 universal_newlines=True)
191 193
192 194
193 class ShardRunner(threading.Thread): 195 class ShardRunner(threading.Thread):
194 """Worker thread that manages a single shard at a time. 196 """Worker thread that manages a single shard at a time.
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 # shard and run the whole test 661 # shard and run the whole test
660 ss = ShardingSupervisor( 662 ss = ShardingSupervisor(
661 test, num_shards_to_run, num_runs, options.color, 663 test, num_shards_to_run, num_runs, options.color,
662 options.original_order, options.prefix, options.retry_percent, 664 options.original_order, options.prefix, options.retry_percent,
663 options.timeout, options.total_slaves, options.slave_index, gtest_args) 665 options.timeout, options.total_slaves, options.slave_index, gtest_args)
664 return ss.ShardTest() 666 return ss.ShardTest()
665 667
666 668
667 if __name__ == "__main__": 669 if __name__ == "__main__":
668 sys.exit(main()) 670 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698