Bug 2062847 - Let the android-gradle-build python tests use non-shippable artifact builds r=firefox-build-system-reviewers,sergesanspaille
The android-gradle-build python tests run artifact builds, but `mach artifact install` only searches the `.shippable` index for opt builds. For each of the 50 candidate pushheads it looks up `gecko.v2.autoland.shippable.revision.<rev>.mobile.android-<arch>-opt`. Shippable Android builds aren't scheduled by default on autoland, so when none of the last 50 autoland pushes ran a shippable build, the search comes up empty, fails with "no built artifacts found", and every artifact-build test in the suite fails at once. It passes only when one of those 50 pushes happens to have a shippable Android build, which is why it shows up as an intermittent. Add a MOZ_ARTIFACT_ALLOW_NON_SHIPPABLE environment variable that makes the index lookup fall back to the regular per-push opt build when no shippable build is found, and set it for the android-gradle-build task. The shippable index is still tried first, so branches that only publish shippable builds (central, beta, release, esr) keep resolving to those. Differential Revision: https://phabricator.services.mozilla.com/D324866
This commit is contained in:
committed by
jcristau@mozilla.com
parent
4c91297a52
commit
e10bbf0dae
@@ -1210,27 +1210,39 @@ class TaskCache(CacheManager):
|
||||
# 'autoland'
|
||||
tree = tree.split("/")[1] if "/" in tree else tree
|
||||
|
||||
# Optimized builds are normally only published to the `.shippable`
|
||||
# index. Some consumers (e.g. the Android Gradle python tests) run on
|
||||
# autoland, where shippable Android builds aren't scheduled by default;
|
||||
# with MOZ_ARTIFACT_ALLOW_NON_SHIPPABLE they fall back to the regular
|
||||
# per-push opt builds. The shippable index is still tried first, so
|
||||
# branches that only publish shippable builds (central, beta, release,
|
||||
# esr) are unaffected. See bug 1768186 for lifting this more generally.
|
||||
if job.endswith("-opt"):
|
||||
tree += ".shippable"
|
||||
|
||||
namespace = f"{job_configuration.trust_domain}.v2.{tree}.revision.{rev}.{job_configuration.product}.{job}"
|
||||
self.log(
|
||||
logging.DEBUG,
|
||||
"artifact",
|
||||
{"namespace": namespace},
|
||||
"Searching Taskcluster index with namespace: {namespace}",
|
||||
)
|
||||
if os.environ.get("MOZ_ARTIFACT_ALLOW_NON_SHIPPABLE"):
|
||||
trees = [f"{tree}.shippable", tree]
|
||||
else:
|
||||
trees = [f"{tree}.shippable"]
|
||||
else:
|
||||
trees = [tree]
|
||||
|
||||
from taskcluster.exceptions import TaskclusterRestFailure
|
||||
|
||||
try:
|
||||
index = get_taskcluster_client("index")
|
||||
task = index.findTask(namespace)
|
||||
taskId = task["taskId"]
|
||||
except (KeyError, TaskclusterRestFailure) as e:
|
||||
if isinstance(e, TaskclusterRestFailure) and e.status_code != 404:
|
||||
raise
|
||||
|
||||
index = get_taskcluster_client("index")
|
||||
for candidate_tree in trees:
|
||||
namespace = f"{job_configuration.trust_domain}.v2.{candidate_tree}.revision.{rev}.{job_configuration.product}.{job}"
|
||||
self.log(
|
||||
logging.DEBUG,
|
||||
"artifact",
|
||||
{"namespace": namespace},
|
||||
"Searching Taskcluster index with namespace: {namespace}",
|
||||
)
|
||||
try:
|
||||
taskId = index.findTask(namespace)["taskId"]
|
||||
break
|
||||
except (KeyError, TaskclusterRestFailure) as e:
|
||||
if isinstance(e, TaskclusterRestFailure) and e.status_code != 404:
|
||||
raise
|
||||
else:
|
||||
# Not all revisions correspond to pushes that produce the job we
|
||||
# care about; and even those that do may not have completed yet.
|
||||
raise ValueError(f"Task for {namespace} does not exist (yet)!")
|
||||
|
||||
@@ -22,6 +22,13 @@ android-gradle-build:
|
||||
MOZ_OBJDIR: obj-firefox
|
||||
PERFHERDER_EXTRA_OPTIONS: android-gradle-build
|
||||
TINDERBOX_OUTPUT: '1'
|
||||
# The tests run artifact builds. Let `mach artifact install` accept
|
||||
# the regular (non-shippable) Android opt builds, which run on every
|
||||
# integration push, instead of only the shippable index. Shippable
|
||||
# Android builds are release-only, so on autoland the shippable
|
||||
# index is almost always empty and the pushhead search fails with
|
||||
# "no built artifacts found" (bug 2062847).
|
||||
MOZ_ARTIFACT_ALLOW_NON_SHIPPABLE: '1'
|
||||
max-run-time: 7200
|
||||
run-on-repo-type: [hg]
|
||||
run:
|
||||
|
||||
Reference in New Issue
Block a user