Bug 1899878 - Add a lull-schedule attribute to some browsertime tasks. r=kshampur,perftest-reviewers DONTBUILD

This patch adds a lull-schedule attribute to some browsertime live-site tasks so that we can start testing lull-scheduling. The lull-schedule attribute will be used to denote how frequently a particular task should run. The lull-schedule attribute exists first as a raptor specific setting, and is then added to the `extra` section so that we can make use of it in the `mozci` module.

Differential Revision: https://phabricator.services.mozilla.com/D212202
This commit is contained in:
Greg Mierzwinski 2024-06-04 23:59:13 +00:00
parent fdc5c7d608
commit 83e10bcf4c
3 changed files with 36 additions and 1 deletions

View File

@ -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.

View File

@ -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

View File

@ -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: