diff --git a/.cron.yml b/.cron.yml index 7ae994f9d775..046479f621d4 100644 --- a/.cron.yml +++ b/.cron.yml @@ -399,3 +399,13 @@ jobs: run-on-projects: [mozilla-beta] when: - {hour: 2, minute: 0} + + - name: os-integration + job: + type: decision-task + treeherder-symbol: osint + target-tasks-method: os-integration + run-on-projects: + - mozilla-central + when: + - {weekday: 'Monday', hour: 6, minute: 0} diff --git a/taskcluster/config.yml b/taskcluster/config.yml index 96ccb91741b1..433befe1ac8c 100644 --- a/taskcluster/config.yml +++ b/taskcluster/config.yml @@ -109,6 +109,7 @@ treeherder: 'M-f-swr-cf': 'Mochitest failures software webrender w/confirm failure' 'M-msix': 'Mochitests from MSIX builds' 'M-msix-cf': 'Mochitests confirm failure from MSIX builds' + 'M-osint': 'Mochitests tagged with os-integration' 'MSI': 'Repack installers into MSIs' 'MSIs': 'Signing of Repacked installers of MSIs' 'MSIX': 'Repack into MSIX package' diff --git a/taskcluster/gecko_taskgraph/target_tasks.py b/taskcluster/gecko_taskgraph/target_tasks.py index 1a38e1d69571..cfccb8d25bd3 100644 --- a/taskcluster/gecko_taskgraph/target_tasks.py +++ b/taskcluster/gecko_taskgraph/target_tasks.py @@ -1727,3 +1727,12 @@ def target_tasks_android_l10n_import(full_task_graph, parameters, graph_config): @register_target_task("android-l10n-sync") def target_tasks_android_l10n_sync(full_task_graph, parameters, graph_config): return [l for l, t in full_task_graph.tasks.items() if l == "android-l10n-sync"] + + +@register_target_task("os-integration") +def target_tasks_os_integration(full_task_graph, parameters, graph_config): + return [ + l + for l, t in full_task_graph.tasks.items() + if t.attributes.get("unittest_variant") == "os-integration" + ] diff --git a/taskcluster/gecko_taskgraph/transforms/test/__init__.py b/taskcluster/gecko_taskgraph/transforms/test/__init__.py index 80169441613c..06cf7068a3bd 100644 --- a/taskcluster/gecko_taskgraph/transforms/test/__init__.py +++ b/taskcluster/gecko_taskgraph/transforms/test/__init__.py @@ -17,7 +17,6 @@ what should run where. this is the wrong place for special-casing platforms, for example - use `all_tests.py` instead. """ - import logging from importlib import import_module @@ -407,10 +406,16 @@ def run_remaining_transforms(config, tasks): ("worker", None), ("confirm_failure", None), ("pernosco", lambda t: t["build-platform"].startswith("linux64")), - # These transforms should always run last as there is never any - # difference in configuration from one chunk to another (other than - # chunk number). + # These transforms should run last as there is never any difference in + # configuration from one chunk to another (other than chunk number). + # Although the os-integration transforms setup an index route that + # depends on the chunk number. ("chunk", None), + ( + "os_integration", + lambda t: t.get("attributes", {}).get("unittest_variant") + == "os-integration", + ), ) for task in tasks: diff --git a/taskcluster/gecko_taskgraph/transforms/test/confirm_failure.py b/taskcluster/gecko_taskgraph/transforms/test/confirm_failure.py index 04f356fc1f60..095c807972bc 100644 --- a/taskcluster/gecko_taskgraph/transforms/test/confirm_failure.py +++ b/taskcluster/gecko_taskgraph/transforms/test/confirm_failure.py @@ -18,7 +18,11 @@ def test_confirm_failure_tasks(config, tasks): yield task continue - if "backlog" in task["suite"] or "failure" in task["suite"]: + if ( + "backlog" in task["suite"] + or "failure" in task["suite"] + or task.get("attributes", {}).get("unittest_variant") == "os-integration" + ): yield task continue diff --git a/taskcluster/gecko_taskgraph/transforms/test/os_integration.py b/taskcluster/gecko_taskgraph/transforms/test/os_integration.py new file mode 100644 index 000000000000..d6ba099807a9 --- /dev/null +++ b/taskcluster/gecko_taskgraph/transforms/test/os_integration.py @@ -0,0 +1,24 @@ +# 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.transforms.base import TransformSequence + +transforms = TransformSequence() + + +@transforms.add +def add_index_route(config, tasks): + project = config.params["project"] + if project != "mozilla-central": + yield from tasks + return + + index_base = f"gecko.v2.{project}.latest.test.os-integration" + for task in tasks: + routing_key = f"{index_base}.{task['test-platform']}.{task['test-name']}" + if task["chunks"] > 1: + routing_key = f"{routing_key}-{task['this-chunk']}" + + task.setdefault("routes", []).append(routing_key) + yield task diff --git a/taskcluster/gecko_taskgraph/util/chunking.py b/taskcluster/gecko_taskgraph/util/chunking.py index fbb64fca6f40..54181446a9ba 100644 --- a/taskcluster/gecko_taskgraph/util/chunking.py +++ b/taskcluster/gecko_taskgraph/util/chunking.py @@ -37,18 +37,11 @@ WPT_SUBSUITES = { def get_test_tags(config, env): - test_tags = [] - try_config = json.loads( + tags = json.loads( config.params["try_task_config"].get("env", {}).get("MOZHARNESS_TEST_TAG", "[]") ) - env_tags = env.get("MOZHARNESS_TEST_TAG", []) - if env_tags: - if try_config: - env_tags.extend(try_config) - test_tags = list(set(env_tags)) - elif try_config: - test_tags = try_config - return test_tags + tags.extend(env.get("MOZHARNESS_TEST_TAG", [])) + return list(set(tags)) def guess_mozinfo_from_task(task, repo="", test_tags=[]): diff --git a/taskcluster/kinds/test/variants.yml b/taskcluster/kinds/test/variants.yml index a361f5a521f5..b1ac89be6a17 100644 --- a/taskcluster/kinds/test/variants.yml +++ b/taskcluster/kinds/test/variants.yml @@ -475,3 +475,18 @@ draw-snapshot: mozharness: extra-options: - "--setpref=reftest.use-draw-snapshot=true" + +os-integration: + description: >- + {description} limited to tests identified as good candidates for validating the test environment. + component: Release Engineering::Firefox-CI Administration + expiration: never + suffix: osint + when: + $eval: >- + "debug" in task["test-platform"] + && !("macosx" in task["test-platform"]) + merge: + worker: + env: + MOZHARNESS_TEST_TAG: ["os_integration"]