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

Unified Diff: third_party/typ/typ/runner.py

Issue 2077273002: Roll third_party/typ to 0.9.5. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/typ/typ/runner.py
diff --git a/third_party/typ/typ/runner.py b/third_party/typ/typ/runner.py
index 38c0e1c554f3d8d3032a281e564da8194feb63e3..c2975f166e96a497741854f17193e08cf935a197 100644
--- a/third_party/typ/typ/runner.py
+++ b/third_party/typ/typ/runner.py
@@ -353,9 +353,18 @@ class Runner(object):
# TODO: Add support for discovering setupProcess/teardownProcess?
- test_set.parallel_tests = _sort_inputs(test_set.parallel_tests)
- test_set.isolated_tests = _sort_inputs(test_set.isolated_tests)
- test_set.tests_to_skip = _sort_inputs(test_set.tests_to_skip)
+ shard_index = args.shard_index
+ total_shards = args.total_shards
+ assert total_shards >= 1
+ assert shard_index >= 0 and shard_index < total_shards, (
+ 'shard_index (%d) must be >= 0 and < total_shards (%d)' %
+ (shard_index, total_shards))
+ test_set.parallel_tests = _sort_inputs(
+ test_set.parallel_tests)[shard_index::total_shards]
+ test_set.isolated_tests = _sort_inputs(
+ test_set.isolated_tests)[shard_index::total_shards]
+ test_set.tests_to_skip = _sort_inputs(
+ test_set.tests_to_skip)[shard_index::total_shards]
return 0, test_set
finally:
unittest.skip = orig_skip
@@ -812,7 +821,7 @@ def _run_one_test(child, test_input):
tests = list(suite)
if len(tests) != 1:
- err = 'Failed to load %s'
+ err = 'Failed to load %s' % test_name
if tb_str: # pragma: untested
err += (' (traceback follows):\n %s' %
' \n'.join(tb_str.splitlines()))

Powered by Google App Engine
This is Rietveld 408576698