os_integration.py (1128B)
1 # This Source Code Form is subject to the terms of the Mozilla Public 2 # License, v. 2.0. If a copy of the MPL was not distributed with this 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 5 6 from taskgraph.transforms.base import TransformSequence 7 8 transforms = TransformSequence() 9 10 11 @transforms.add 12 def maybe_setup_os_integration(config, tasks): 13 if ( 14 config.params["tasks_for"] != "cron" 15 or config.params["target_tasks_method"] != "os-integration" 16 ): 17 yield from tasks 18 return 19 20 for task in tasks: 21 # Tags are ignored for raptor / talos. Marionette unittest 22 # doesn't support dynamic chunking. 23 if task["suite"] in ("raptor", "talos", "marionette-unittest"): 24 yield task 25 continue 26 27 if ( 28 task.get("test-manifest-loader", True) is not None 29 and isinstance(task["chunks"], int) 30 and task["chunks"] > 1 31 ): 32 task["chunks"] = "dynamic" 33 34 env = task.setdefault("worker", {}).setdefault("env", {}) 35 env["MOZHARNESS_TEST_TAG"] = ["os_integration"] 36 yield task