mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Backed out changeset 375bf84f1825 (bug 1363714) for flake8 failures a=backout
MozReview-Commit-ID: 5NGFjeBeyrM
This commit is contained in:
parent
bd4843d1a5
commit
7b7195de55
@ -35,8 +35,6 @@ from voluptuous import (
|
||||
|
||||
import copy
|
||||
import logging
|
||||
import requests
|
||||
from collections import defaultdict
|
||||
|
||||
WORKER_TYPE = {
|
||||
# default worker types keyed by instance-size
|
||||
@ -396,19 +394,21 @@ def set_treeherder_machine_platform(config, tests):
|
||||
def set_worker_implementation(config, tests):
|
||||
"""Set the worker implementation based on the test platform."""
|
||||
for test in tests:
|
||||
test_platform = test['test-platform']
|
||||
if test_platform.startswith('macosx'):
|
||||
if config.config['args'].taskcluster_worker:
|
||||
if test['test-platform'].startswith('macosx'):
|
||||
# see if '-g' appears in try syntax
|
||||
if config.config['args'].generic_worker:
|
||||
test['worker-implementation'] = 'generic-worker'
|
||||
# see if '-w' appears in try syntax
|
||||
elif config.config['args'].taskcluster_worker:
|
||||
test['worker-implementation'] = 'native-engine'
|
||||
else:
|
||||
test['worker-implementation'] = 'generic-worker'
|
||||
test['worker-implementation'] = 'buildbot-bridge'
|
||||
elif test.get('suite', '') == 'talos':
|
||||
test['worker-implementation'] = 'buildbot-bridge'
|
||||
elif test_platform.startswith('win'):
|
||||
elif test['test-platform'].startswith('win'):
|
||||
test['worker-implementation'] = 'generic-worker'
|
||||
else:
|
||||
test['worker-implementation'] = 'docker-worker'
|
||||
|
||||
yield test
|
||||
|
||||
|
||||
@ -667,33 +667,6 @@ def parallel_stylo_tests(config, tests):
|
||||
yield test
|
||||
|
||||
|
||||
@transforms.add
|
||||
def allocate_to_bbb(config, tests):
|
||||
"""Make the load balancing between taskcluster and buildbot"""
|
||||
j = get_load_balacing_settings()
|
||||
|
||||
tests_set = defaultdict(list)
|
||||
for test in tests:
|
||||
tests_set[test['test-platform']].append(test)
|
||||
|
||||
# Make the load balancing between taskcluster and buildbot
|
||||
for test_platform, t in tests_set.iteritems():
|
||||
# We sort the list to make the order of the tasks deterministic
|
||||
t.sort(key=lambda x: (x['test-name'], x.get('this_chunk', 1)))
|
||||
# The json file tells the percentage of tasks that run on
|
||||
# taskcluster. The logic here is inverted, as tasks have been
|
||||
# previously assigned to taskcluster. Therefore we assign the
|
||||
# 1-p tasks to buildbot-bridge.
|
||||
n = j.get(test_platform, 1.0)
|
||||
if not (test_platform.startswith('mac') \
|
||||
and config.config['args'].taskcluster_worker):
|
||||
for i in range(int(n * len(t)), len(t)):
|
||||
t[i]['worker-implementation'] = 'buildbot-bridge'
|
||||
|
||||
for y in t:
|
||||
yield y
|
||||
|
||||
|
||||
@transforms.add
|
||||
def make_job_description(config, tests):
|
||||
"""Convert *test* descriptions to *job* descriptions (input to
|
||||
@ -794,10 +767,3 @@ def normpath(path):
|
||||
def get_firefox_version():
|
||||
with open('browser/config/version.txt', 'r') as f:
|
||||
return f.readline().strip()
|
||||
|
||||
def get_load_balacing_settings():
|
||||
url = "https://s3.amazonaws.com/taskcluster-graph-scheduling/tests-load.json"
|
||||
try:
|
||||
return requests.get(url).json()
|
||||
except Exception:
|
||||
return {}
|
||||
|
@ -243,6 +243,9 @@ def parse_message(message):
|
||||
# this temporary option to be able to push jobs to tc-worker.
|
||||
parser.add_argument('-w', '--taskcluster-worker',
|
||||
dest='taskcluster_worker', action='store_true', default=False)
|
||||
# Similarly, an extra flag for enabling os x jobs in generic-worker
|
||||
parser.add_argument('-g', '--generic-worker',
|
||||
dest='generic_worker', action='store_true', default=False)
|
||||
|
||||
# In order to run test jobs multiple times
|
||||
parser.add_argument('--rebuild', dest='trigger_tests', type=int, default=1)
|
||||
|
Loading…
Reference in New Issue
Block a user