# 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 taskgraph.target_tasks import register_target_task, target_tasks_default
def filter_platform(platform, task): if"build_platform"notin task.attributes: returnFalse if platform == "all": returnTrue
task_platform = task.attributes["build_platform"] # Check the platform name.
keep = task_platform == PLATFORM_ALIASES.get(platform, platform) # Additional checks. if platform == "linux64-fips":
keep &= task.attributes["fips"] elif (
platform == "linux64-make" or platform == "linux-make" or platform == "win64-make" or platform == "win-make" or platform == "aarch64-make" or platform == "mac-make"
):
keep &= task.attributes["make"] elif platform == "linux64-fuzz"or platform == "linux-fuzz":
keep &= task.attributes["fuzz"] return keep
def filter_try_syntax(options, task):
symbol = task.task["extra"]["treeherder"]["symbol"].lower()
group = task.task["extra"]["treeherder"].get("groupSymbol", "").lower()
# Filter tools. We can immediately return here as those # are not affected by platform or build type selectors. if task.kind == "tools": return any(t in options["tools"] for t in ["all", symbol])
# Filter unit tests. if task.kind == "test":
tests = {"all", symbol} if group in ("cipher", "ssl"):
tests.add(group) ifnot any(t in options["unittests"] for t in tests): returnFalse
# Filter extra builds. if group == "builds"andnot options["extra"]: returnFalse
# Filter by platform. ifnot any(filter_platform(platform, task) for platform in options["platforms"]): returnFalse
# Finally, filter by build type. return filter_build_type(options["builds"], task)
@register_target_task("nss_try_tasks") def target_tasks_try(full_task_graph, parameters, graph_config): ifnot parameters["try_options"]: return target_tasks_default(full_task_graph, parameters, graph_config) return [
t.label for t in full_task_graph if filter_try_syntax(parameters["try_options"], t)
]
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.