Commit c02e4d7a authored by Haiyang Pan's avatar Haiyang Pan Committed by Commit Bot

Add a new argument "--tags" to the "run" command for mb.py

So that users add customized tags for the triggered swarming task.

Change-Id: Iefbab2c67360ed09719571eca24074b91a28fa00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392864Reviewed-by: default avatarBen Pastene <bpastene@chromium.org>
Commit-Queue: Haiyang Pan <hypan@google.com>
Cr-Commit-Position: refs/heads/master@{#804496}
parent 234f36e9
...@@ -297,6 +297,8 @@ class MetaBuildWrapper(object): ...@@ -297,6 +297,8 @@ class MetaBuildWrapper(object):
subp.add_argument('-d', '--dimension', default=[], action='append', nargs=2, subp.add_argument('-d', '--dimension', default=[], action='append', nargs=2,
dest='dimensions', metavar='FOO bar', dest='dimensions', metavar='FOO bar',
help='dimension to filter on') help='dimension to filter on')
subp.add_argument('--tags', default=[], action='append', metavar='FOO:BAR',
help='Tags to assign to the swarming task')
subp.add_argument('--no-default-dimensions', action='store_false', subp.add_argument('--no-default-dimensions', action='store_false',
dest='default_dimensions', default=True, dest='default_dimensions', default=True,
help='Do not automatically add dimensions to the task') help='Do not automatically add dimensions to the task')
...@@ -591,6 +593,8 @@ class MetaBuildWrapper(object): ...@@ -591,6 +593,8 @@ class MetaBuildWrapper(object):
file=sys.stderr) file=sys.stderr)
return 1 return 1
tags = ['--tags=%s' % tag for tag in self.args.tags]
cmd = [ cmd = [
self.executable, self.executable,
self.PathJoin('tools', 'swarming_client', 'swarming.py'), self.PathJoin('tools', 'swarming_client', 'swarming.py'),
...@@ -600,7 +604,7 @@ class MetaBuildWrapper(object): ...@@ -600,7 +604,7 @@ class MetaBuildWrapper(object):
'--namespace', namespace, '--namespace', namespace,
'-S', swarming_server, '-S', swarming_server,
'--tags=purpose:user-debug-mb', '--tags=purpose:user-debug-mb',
] + dimensions ] + tags + dimensions
if self.args.extra_args: if self.args.extra_args:
cmd += ['--'] + self.args.extra_args cmd += ['--'] + self.args.extra_args
self.Print('') self.Print('')
......
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