summaryrefslogtreecommitdiffstats
path: root/taskcluster/gecko_taskgraph/transforms/snap_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /taskcluster/gecko_taskgraph/transforms/snap_test.py
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'taskcluster/gecko_taskgraph/transforms/snap_test.py')
-rw-r--r--taskcluster/gecko_taskgraph/transforms/snap_test.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/taskcluster/gecko_taskgraph/transforms/snap_test.py b/taskcluster/gecko_taskgraph/transforms/snap_test.py
new file mode 100644
index 0000000000..e6d879f225
--- /dev/null
+++ b/taskcluster/gecko_taskgraph/transforms/snap_test.py
@@ -0,0 +1,48 @@
+# 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/.
+"""
+"""
+
+
+import logging
+
+from taskgraph.transforms.base import TransformSequence
+from taskgraph.util.dependencies import get_primary_dependency
+from taskgraph.util.treeherder import inherit_treeherder_from_dep
+
+logger = logging.getLogger(__name__)
+
+transforms = TransformSequence()
+
+
+@transforms.add
+def fill_template(config, tasks):
+ for task in tasks:
+ test_type = task.get("attributes")["snap_test_type"]
+
+ assert "-test-" in task.get("label")
+ task["label"] = task.get("label").replace("-test-", "-test-" + test_type + "-")
+
+ dep = get_primary_dependency(config, task)
+ assert dep
+
+ inherit_treeherder_from_dep(task, dep)
+ task_platform = task["task"]["extra"]["treeherder"]["machine"]["platform"]
+
+ # Disambiguate the treeherder symbol.
+ full_platform_collection = (
+ task_platform + "-snap-" + task.get("label").split("-")[-1]
+ )
+ (platform, collection) = full_platform_collection.split("/")
+ task["task"]["extra"]["treeherder"]["collection"] = {collection: True}
+ task["task"]["extra"]["treeherder"]["machine"]["platform"] = platform
+ task["task"]["extra"]["treeherder-platform"] = full_platform_collection
+ task["task"]["metadata"]["name"] = task["label"]
+
+ timeout = 10
+ if collection != "opt":
+ timeout = 60
+ task["task"]["payload"]["env"]["TEST_TIMEOUT"] = "{}".format(timeout)
+
+ yield task