Bug 1281004: disable legacy test generation draft
authorDustin J. Mitchell <dustin@mozilla.com>
Mon, 27 Jun 2016 19:53:37 +0000
changeset 384314 00a147bfc031f24d626ba8ffef0724a01dc1f4b1
parent 384313 047543f20150a226ca32a79834fa4d7208059b7b
child 384315 38b78f53570d7e57e566bc9b93888c14231f438d
push id22238
push userdmitchell@mozilla.com
push dateWed, 06 Jul 2016 02:09:29 +0000
bugs1281004
milestone50.0a1
Bug 1281004: disable legacy test generation MozReview-Commit-ID: A5lN4wJlIhM
taskcluster/taskgraph/kind/legacy.py
--- a/taskcluster/taskgraph/kind/legacy.py
+++ b/taskcluster/taskgraph/kind/legacy.py
@@ -1,15 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import absolute_import, print_function, unicode_literals
 
-import copy
 import json
 import logging
 import os
 import re
 import time
 from collections import namedtuple
 
 from . import base
@@ -552,87 +551,16 @@ class LegacyTask(base.Task):
                 if project == "try":
                     set_expiration(post_task, TRY_EXPIRATION)
 
                 post_task['attributes'] = attributes.copy()
                 post_task['attributes']['legacy_kind'] = 'post_build'
                 post_task['attributes']['post_build'] = post_build['job_flag']
                 graph['tasks'].append(post_task)
 
-            for test in build['dependents']:
-                test = test['allowed_build_tasks'][build['task']]
-                # TODO additional-parameters is currently not an option, only
-                # enabled for build tasks
-                test_parameters = merge_dicts(build_parameters,
-                                              test.get('additional-parameters', {}))
-                test_parameters = copy.copy(build_parameters)
-
-                test_definition = templates.load(test['task'], {})['task']
-                chunk_config = test_definition['extra'].get('chunks', {})
-
-                # Allow branch configs to override task level chunking...
-                if 'chunks' in test:
-                    chunk_config['total'] = test['chunks']
-
-                chunked = 'total' in chunk_config
-                if chunked:
-                    test_parameters['total_chunks'] = chunk_config['total']
-
-                if 'suite' in test_definition['extra']:
-                    suite_config = test_definition['extra']['suite']
-                    test_parameters['suite'] = suite_config['name']
-                    test_parameters['flavor'] = suite_config.get('flavor', '')
-
-                for chunk in range(1, chunk_config.get('total', 1) + 1):
-                    if 'only_chunks' in test and chunked and \
-                            chunk not in test['only_chunks']:
-                        continue
-
-                    if chunked:
-                        test_parameters['chunk'] = chunk
-                    test_task = configure_dependent_task(test['task'],
-                                                         test_parameters,
-                                                         mklabel(),
-                                                         templates,
-                                                         build_treeherder_config)
-                    set_interactive_task(test_task, interactive)
-
-                    decorate_task_treeherder_routes(test_task['task'],
-                                                    test_parameters['project'],
-                                                    test_parameters['head_rev'],
-                                                    test_parameters['pushlog_id'])
-
-                    if project == "try":
-                        set_expiration(test_task, TRY_EXPIRATION)
-
-                    test_task['attributes'] = attributes.copy()
-                    test_task['attributes']['legacy_kind'] = 'unittest'
-                    test_task['attributes']['test_platform'] = attributes['build_platform']
-                    test_task['attributes']['unittest_try_name'] = test['unittest_try_name']
-                    for param, attr in [
-                            ('suite', 'unittest_suite'),
-                            ('flavor', 'unittest_flavor'),
-                            ('chunk', 'test_chunk')]:
-                        if param in test_parameters:
-                            test_task['attributes'][attr] = str(test_parameters[param])
-
-                    # This will schedule test jobs N times
-                    for i in range(0, trigger_tests):
-                        graph['tasks'].append(test_task)
-                        # If we're scheduling more tasks each have to be unique
-                        test_task = copy.deepcopy(test_task)
-                        test_task['taskId'] = mklabel()
-
-                    define_task = DEFINE_TASK.format(
-                        test_task['task']['workerType']
-                    )
-
-                    graph['scopes'].add(define_task)
-                    graph['scopes'] |= set(test_task['task'].get('scopes', []))
-
         graph['scopes'] = sorted(graph['scopes'])
 
         # Convert to a dictionary of tasks.  The process above has invented a
         # taskId for each task, and we use those as the *labels* for the tasks;
         # taskgraph will later assign them new taskIds.
         return [
             cls(kind, t['taskId'], task=t['task'], attributes=t['attributes'], task_dict=t)
             for t in graph['tasks']