Skip to content

Commit db28226

Browse files
committed
Bug 1769098 - initial work to allow taskcluster/mozbase/mozharness to support conditioned profiles. r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D146220
1 parent 41bc97f commit db28226

File tree

6 files changed

+33
-5
lines changed

6 files changed

+33
-5
lines changed

build/gen_test_packages_manifest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@ def generate_package_data(args):
109109
harness_requirements = dict([(k, [tests_common]) for k in ALL_HARNESSES])
110110
harness_requirements["jittest"].append(jsshell)
111111
harness_requirements["jsreftest"].append(args.reftest)
112+
harness_requirements["common"].append("target.condprof.tests.tar.gz")
112113
for harness in PACKAGE_SPECIFIED_HARNESSES + OPTIONAL_PACKAGES:
113114
pkg_name = getattr(args, harness, None)
114115
if pkg_name is None:
115116
continue
116117
harness_requirements[harness].append(pkg_name)
118+
harness_requirements[harness].append("target.condprof.tests.tar.gz")
117119
return harness_requirements
118120

119121

taskcluster/gecko_taskgraph/test/test_util_chunking.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ def inner(
159159
"headless": headless,
160160
"tsan": tsan,
161161
"appname": "firefox",
162+
"condprof": False,
162163
}
163164

164165
return inner

taskcluster/gecko_taskgraph/util/chunking.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from abc import ABCMeta, abstractmethod
1212

1313
from manifestparser import TestManifest
14-
from manifestparser.filters import chunk_by_runtime
14+
from manifestparser.filters import chunk_by_runtime, tags
1515
from mozbuild.util import memoize
1616
from moztest.resolve import (
1717
TEST_SUITES,
@@ -56,6 +56,7 @@ def guess_mozinfo_from_task(task):
5656
for key in setting["runtime"].keys()
5757
),
5858
"headless": "-headless" in task["test-name"],
59+
"condprof": "conditioned_profile" in setting["runtime"].keys(),
5960
"tsan": setting["build"].get("tsan", False),
6061
"xorigin": any("xorigin" in key for key in setting["runtime"].keys()),
6162
"socketprocess_networking": "socketprocess_networking"
@@ -227,10 +228,14 @@ def get_manifests(self, suite, mozinfo):
227228

228229
manifests = {chunk_by_runtime.get_manifest(t) for t in tests}
229230

231+
filters = None
232+
if mozinfo["condprof"]:
233+
filters = [tags(["condprof"])]
234+
230235
# Compute the active tests.
231236
m = TestManifest()
232237
m.tests = tests
233-
tests = m.active_tests(disabled=False, exists=False, **mozinfo)
238+
tests = m.active_tests(disabled=False, exists=False, filters=filters, **mozinfo)
234239
active = {chunk_by_runtime.get_manifest(t) for t in tests}
235240
skipped = manifests - active
236241
return {"active": list(active), "skipped": list(skipped)}

testing/condprofile/condprof/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
TC_SERVICE = "https://firefox-ci-tc.services.mozilla.com"
3030
ROOT_URL = TC_SERVICE + "/api/index"
31-
INDEX_PATH = "gecko.v2.%(repo)s.latest.firefox.condprof-%(platform)s"
31+
INDEX_PATH = "gecko.v2.%(repo)s.latest.firefox.condprof-%(platform)s-%(scenario)s"
3232
PUBLIC_DIR = "artifacts/public/condprof"
3333
TC_LINK = ROOT_URL + "/v1/task/" + INDEX_PATH + "/" + PUBLIC_DIR + "/"
3434
ARTIFACT_NAME = "profile-%(platform)s-%(scenario)s-%(customization)s.tgz"
@@ -135,6 +135,7 @@ def get_profile(
135135
If task_id is provided, will grab the profile from that task. when not
136136
provided (default) will grab the latest profile.
137137
"""
138+
138139
# XXX assert values
139140
params = {
140141
"platform": platform,
@@ -212,8 +213,8 @@ def onerror(error):
212213
raise ProfileNotFoundError(url)
213214

214215

215-
def read_changelog(platform, repo="mozilla-central"):
216-
params = {"platform": platform, "repo": repo}
216+
def read_changelog(platform, repo="mozilla-central", scenario="settled"):
217+
params = {"platform": platform, "repo": repo, "scenario": scenario}
217218
changelog_url = CHANGELOG_LINK % params
218219
logger.info("Getting %s" % changelog_url)
219220
download_dir = tempfile.mkdtemp()

testing/config/mozbase_requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@
2121
../mozbase/mozscreenshot
2222
../mozbase/moztest
2323
../mozbase/mozversion
24+
25+
../condprofile
26+
aiohttp==3.7.4.post0
27+
https://pypi.pub.build.mozilla.org/pub/arsenic-19.1-py3-none-any.whl
28+
requests==2.22.0
29+
pyyaml==5.1.2
30+
structlog==15.2.0

testing/mozharness/scripts/desktop_unittest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,15 @@ class DesktopUnittest(TestingMixin, MercurialScript, MozbaseMixin, CodeCoverageM
305305
"help": "do not run tests with fission enabled.",
306306
},
307307
],
308+
[
309+
["--conditioned-profile"],
310+
{
311+
"action": "store_true",
312+
"default": False,
313+
"dest": "conditioned_profile",
314+
"help": "run tests with a conditioned profile",
315+
},
316+
],
308317
]
309318
+ copy.deepcopy(testing_config_options)
310319
+ copy.deepcopy(code_coverage_config_options)
@@ -645,6 +654,9 @@ def _query_abs_base_cmd(self, suite_category, suite):
645654
if c["crash_as_pass"]:
646655
base_cmd.append("--crash-as-pass")
647656

657+
if c["conditioned_profile"]:
658+
base_cmd.append("--conditioned-profile")
659+
648660
# set pluginsPath
649661
abs_res_plugins_dir = os.path.join(abs_res_dir, "plugins")
650662
str_format_values["test_plugin_path"] = abs_res_plugins_dir

0 commit comments

Comments
 (0)