diff --git a/taskcluster/docs/attributes.rst b/taskcluster/docs/attributes.rst index e014031303b9..8b82fa9986ed 100644 --- a/taskcluster/docs/attributes.rst +++ b/taskcluster/docs/attributes.rst @@ -529,5 +529,8 @@ Used by android browsertime tasks to track the path to the apk of the product un test-manifests ============== - A list of the test manifests that run in this task. + +lull-schedule +============= +Used by performance tasks to schedule them at a specified frequency in a best-effort method. Schedules them when the overall CI load is low for a given platform. Use "w" for weeks, "d" for days, "h" for hours, and "m" for minutes in a string like so to specify the scheduling frequency: 1d, 1w 4h, 2w 4d 1h. diff --git a/taskcluster/gecko_taskgraph/transforms/test/raptor.py b/taskcluster/gecko_taskgraph/transforms/test/raptor.py index 68241bc585e5..42adca34d4c3 100644 --- a/taskcluster/gecko_taskgraph/transforms/test/raptor.py +++ b/taskcluster/gecko_taskgraph/transforms/test/raptor.py @@ -30,6 +30,9 @@ raptor_description_schema = Schema( Optional("test-url-param"): optionally_keyed_by( "subtest", "test-platform", str ), + Optional("lull-schedule"): optionally_keyed_by( + "subtest", "test-platform", str + ), }, # Configs defined in the 'test_description_schema'. Optional("max-run-time"): optionally_keyed_by( @@ -163,6 +166,7 @@ def handle_keyed_by(config, tests): "raptor.run-visual-metrics", "raptor.activity", "raptor.binary-path", + "raptor.lull-schedule", "limit-platforms", "fetches.fetch", "max-run-time", @@ -339,6 +343,18 @@ def modify_mozharness_configs(config, tests): yield test +@transforms.add +def handle_lull_schedule(config, tests): + # Setup lull schedule attribute here since the attributes + # can't have any keyed by settings + for test in tests: + if "lull-schedule" in test["raptor"]: + lull_schedule = test["raptor"].pop("lull-schedule") + if lull_schedule: + test.setdefault("attributes", {})["lull-schedule"] = lull_schedule + yield test + + @task_transforms.add def add_scopes_and_proxy(config, tasks): for task in tasks: @@ -347,3 +363,15 @@ def add_scopes_and_proxy(config, tasks): "secrets:get:project/perftest/gecko/level-{level}/perftest-login" ) yield task + + +@task_transforms.add +def setup_lull_schedule(config, tasks): + for task in tasks: + attrs = task.setdefault("attributes", {}) + if attrs.get("lull-schedule", None) is not None: + # Move the lull schedule attribute into the extras + # so that it can be accessible through mozci + lull_schedule = attrs.pop("lull-schedule") + task.setdefault("extra", {})["lull-schedule"] = lull_schedule + yield task diff --git a/taskcluster/kinds/test/browsertime-desktop.yml b/taskcluster/kinds/test/browsertime-desktop.yml index 87f427218dd1..96d829d4ee0b 100644 --- a/taskcluster/kinds/test/browsertime-desktop.yml +++ b/taskcluster/kinds/test/browsertime-desktop.yml @@ -659,6 +659,10 @@ browsertime-tp6-live: apps: [firefox, chrome, safari] test: tp6 run-visual-metrics: true + lull-schedule: + by-test-platform: + .*shippable.*: 1w + default: "" subtests: by-app: safari: