Bug 1593151 [wpt PR 20041] - Fix generation of TC URLs, a=testonly

Automatic update from web-platform-tests
Fix generation of TC URLs (#20041)

--

wpt-commits: 424249088dd679888e07bd315dd8ebc98ccf323a
wpt-pr: 20041

Differential Revision: https://phabricator.services.mozilla.com/D53618
This commit is contained in:
Dustin J. Mitchell 2019-11-04 12:00:17 +00:00 committed by moz-wptsync-bot
parent bda2adfe70
commit 463908bfef
3 changed files with 30 additions and 8 deletions

View File

@ -51,9 +51,6 @@ except ImportError:
from urllib.request import urlopen
QUEUE_BASE = "https://queue.taskcluster.net/v1/task"
root = os.path.abspath(
os.path.join(os.path.dirname(__file__),
os.pardir,
@ -325,7 +322,14 @@ def fetch_event_data():
# For example under local testing
return None
resp = urlopen("%s/%s" % (QUEUE_BASE, task_id))
root_url = os.environ['TASKCLUSTER_ROOT_URL']
if root_url == 'https://taskcluster.net':
queue_base = "https://queue.taskcluster.net/v1/task"
else:
queue_base = root_url + "/api/queue/v1/task"
resp = urlopen("%s/%s" % (queue_base, task_id))
task_data = json.load(resp)
event_data = task_data.get("extra", {}).get("github_event")

View File

@ -10,6 +10,10 @@ import github
logging.basicConfig()
logger = logging.getLogger("tc-download")
# The root URL of the Taskcluster deployment from which to download wpt reports
# (after https://bugzilla.mozilla.org/show_bug.cgi?id=1574668 lands, this will
# be https://community-tc.services.mozilla.com)
TASKCLUSTER_ROOT_URL = 'https://taskcluster.net'
def get_parser():
parser = argparse.ArgumentParser()
@ -74,8 +78,13 @@ def run(*args, **kwargs):
return 1
for taskgroup in taskgroups:
taskgroup_url = "https://queue.taskcluster.net/v1/task-group/%s/list"
artifacts_list_url = "https://queue.taskcluster.net/v1/task/%s/artifacts"
if TASKCLUSTER_ROOT_URL == 'https://taskcluster.net':
# NOTE: this condition can be removed after November 9, 2019
taskgroup_url = "https://queue.taskcluster.net/v1/task-group/%s/list"
artifacts_list_url = "https://queue.taskcluster.net/v1/task/%s/artifacts"
else:
taskgroup_url = TASKCLUSTER_ROOT_URL + "/api/queue/v1/task-group/%s/list"
artifacts_list_url = TASKCLUSTER_ROOT_URL + "/api/queue/v1/task/%s/artifacts"
tasks = get_json(taskgroup_url % taskgroup, "tasks")
for task in tasks:
task_id = task["status"]["taskId"]

View File

@ -17,6 +17,10 @@ from utils import call, get, untar, unzip
uname = platform.uname()
# the rootUrl for the firefox-ci deployment of Taskcluster
# (after November 9, https://firefox-ci-tc.services.mozilla.com/)
FIREFOX_CI_ROOT_URL = 'https://taskcluster.net'
def _get_fileversion(binary, logger=None):
command = "(Get-Item '%s').VersionInfo.FileVersion" % binary.replace("'", "''")
@ -423,8 +427,13 @@ class FirefoxAndroid(Browser):
if dest is None:
dest = os.pwd
TC_QUEUE_BASE = "https://queue.taskcluster.net/v1/"
TC_INDEX_BASE = "https://index.taskcluster.net/v1/"
if FIREFOX_CI_ROOT_URL == 'https://taskcluster.net':
# NOTE: this condition can be removed after November 9, 2019
TC_QUEUE_BASE = "https://queue.taskcluster.net/v1/"
TC_INDEX_BASE = "https://index.taskcluster.net/v1/"
else:
TC_QUEUE_BASE = FIREFOX_CI_ROOT_URL + "/api/queue/v1/"
TC_INDEX_BASE = FIREFOX_CI_ROOT_URL + "/api/index/v1/"
resp = requests.get(TC_INDEX_BASE +