Commit a1477bef by Jamie Madill Committed by Commit Bot

trigger.py: Append user tag.

This puts the output of 'whoami' into the user tag. This is useful for finding your triggered swarming tasks. Implemented while working on triggering standalone dEQP test runs. Bug: angleproject:5157 Change-Id: Ic850726485a96408c8f2ded36195268eabb275f4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2463370Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 75de9ef2
...@@ -11,6 +11,7 @@ import argparse ...@@ -11,6 +11,7 @@ import argparse
import hashlib import hashlib
import logging import logging
import os import os
import re
import subprocess import subprocess
import sys import sys
...@@ -69,6 +70,15 @@ def main(): ...@@ -69,6 +70,15 @@ def main():
'-s', sha '-s', sha
] ]
# Define a user tag.
try:
whoami = subprocess.check_output(['whoami'])
# Strip extra stuff (e.g. on Windows we are 'hostname\username')
whoami = re.sub(r'\w+[^\w]', '', whoami.strip())
swarming_args += ['-user', whoami]
except:
pass
if args.gpu: if args.gpu:
swarming_args += ['-d', 'gpu=' + args.gpu] swarming_args += ['-d', 'gpu=' + args.gpu]
......
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