Commit cbb52cd2 authored by Ben Pastene's avatar Ben Pastene Committed by Commit Bot

Fix custom cros hw swarming trigger script. And make it hopefully future-proof.

It broke again after https://chromium-review.googlesource.com/c/chromium/tools/build/+/1501474

This should make it immune to future relands + reverts of the same change.

Bug: 926987, 938211
Change-Id: I99654cc71b1c8a83fdd29defc20b1e35cddb3fae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504039Reviewed-by: default avatarJohn Budorick <jbudorick@chromium.org>
Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Commit-Queue: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637863}
parent 9572cdcf
...@@ -69,11 +69,16 @@ def parse_args(triggerer): ...@@ -69,11 +69,16 @@ def parse_args(triggerer):
help='How long to wait (in seconds) for an available bot in the primary ' help='How long to wait (in seconds) for an available bot in the primary '
'task slice.') 'task slice.')
# BaseTestTriggerer's setup_parser_contract() takes care of adding needed # BaseTestTriggerer's setup_parser_contract() takes care of adding needed
# swarming.py args if they're not already present. # swarming.py args if they're not already present. But only do this if
base_test_triggerer.BaseTestTriggerer.setup_parser_contract(parser) # '--shard-index' is passed in. (The exact usage of trigger scripts are
args, additional_args = parser.parse_known_args() # currently changing. See crbug.com/926987 for more info.)
additional_args = triggerer.modify_args( if '--shard-index' in sys.argv:
additional_args, 0, args.shard_index, args.shards, args.dump_json) base_test_triggerer.BaseTestTriggerer.setup_parser_contract(parser)
args, additional_args = parser.parse_known_args()
additional_args = triggerer.modify_args(
additional_args, 0, args.shard_index, args.shards, args.dump_json)
else:
args, additional_args = parser.parse_known_args()
if additional_args[0] != 'trigger': if additional_args[0] != 'trigger':
parser.error( parser.error(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment