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

Unified Diff: third_party/typ/typ/arg_parser.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/arg_parser.py
diff --git a/third_party/typ/typ/arg_parser.py b/third_party/typ/typ/arg_parser.py
index cb51711a369a586d79ececca02e685c698cd31e9..f7a602669816bdd4327fde54febd8972bbb70a9d 100644
--- a/third_party/typ/typ/arg_parser.py
+++ b/third_party/typ/typ/arg_parser.py
@@ -147,6 +147,14 @@ class ArgumentParser(argparse.ArgumentParser):
self.add_argument('--passthrough', action='store_true',
default=False,
help='Prints all output while running.')
+ self.add_argument('--total-shards', default=1, type=int,
+ help=('Total number of shards being used for '
+ 'this test run. (The user of '
+ 'this script is responsible for spawning '
+ 'all of the shards.)'))
+ self.add_argument('--shard-index', default=0, type=int,
+ help=('Shard index (0..total_shards-1) of this '
+ 'test run.'))
self.add_argument('--retry-limit', type=int, default=0,
help='Retries each failure up to N times.')
self.add_argument('--terminal-width', type=int,
@@ -193,6 +201,20 @@ class ArgumentParser(argparse.ArgumentParser):
'along with --test-result-server')
self.exit_status = 2
+ if rargs.total_shards < 1:
+ self._print_message('Error: --total-shards must be at least 1')
+ self.exit_status = 2
+
+ if rargs.shard_index < 0:
+ self._print_message('Error: --shard-index must be at least 0')
+ self.exit_status = 2
+
+ if rargs.shard_index >= rargs.total_shards:
+ self._print_message('Error: --shard-index must be no more than '
+ 'the number of shards (%i) minus 1' %
+ rargs.total_shards)
+ self.exit_status = 2
+
if not rargs.suffixes:
rargs.suffixes = DEFAULT_SUFFIXES

Powered by Google App Engine
This is Rietveld 408576698