summaryrefslogtreecommitdiffstats
path: root/testing/mozharness/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /testing/mozharness/scripts
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/mozharness/scripts')
-rw-r--r--testing/mozharness/scripts/android_emulator_pgo.py4
-rw-r--r--testing/mozharness/scripts/android_emulator_unittest.py4
-rw-r--r--testing/mozharness/scripts/android_hardware_unittest.py5
-rw-r--r--testing/mozharness/scripts/release/update-verify-config-creator.py105
-rwxr-xr-xtesting/mozharness/scripts/web_platform_tests.py22
5 files changed, 70 insertions, 70 deletions
diff --git a/testing/mozharness/scripts/android_emulator_pgo.py b/testing/mozharness/scripts/android_emulator_pgo.py
index c0e9c5e78a..885c4861bb 100644
--- a/testing/mozharness/scripts/android_emulator_pgo.py
+++ b/testing/mozharness/scripts/android_emulator_pgo.py
@@ -100,9 +100,9 @@ class AndroidProfileRun(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
dirs = {}
dirs["abs_test_install_dir"] = os.path.join(abs_dirs["abs_src_dir"], "testing")
- dirs["abs_xre_dir"] = os.path.join(abs_dirs["abs_work_dir"], "hostutils")
dirs["abs_blob_upload_dir"] = "/builds/worker/artifacts/blobber_upload_dir"
work_dir = os.environ.get("MOZ_FETCHES_DIR") or abs_dirs["abs_work_dir"]
+ dirs["abs_xre_dir"] = os.path.join(work_dir, "hostutils")
dirs["abs_sdk_dir"] = os.path.join(work_dir, "android-sdk-linux")
dirs["abs_avds_dir"] = os.path.join(work_dir, "android-device")
dirs["abs_bundletool_path"] = os.path.join(work_dir, "bundletool.jar")
@@ -134,7 +134,7 @@ class AndroidProfileRun(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
Download host utilities
"""
dirs = self.query_abs_dirs()
- self.xre_path = self.download_hostutils(dirs["abs_xre_dir"])
+ self.xre_path = dirs["abs_xre_dir"]
def install(self):
"""
diff --git a/testing/mozharness/scripts/android_emulator_unittest.py b/testing/mozharness/scripts/android_emulator_unittest.py
index 7d798668e5..66b3c0b5fd 100644
--- a/testing/mozharness/scripts/android_emulator_unittest.py
+++ b/testing/mozharness/scripts/android_emulator_unittest.py
@@ -209,7 +209,6 @@ class AndroidEmulatorTest(
dirs["abs_test_bin_dir"] = os.path.join(
abs_dirs["abs_work_dir"], "tests", "bin"
)
- dirs["abs_xre_dir"] = os.path.join(abs_dirs["abs_work_dir"], "hostutils")
dirs["abs_modules_dir"] = os.path.join(dirs["abs_test_install_dir"], "modules")
dirs["abs_blob_upload_dir"] = os.path.join(
abs_dirs["abs_work_dir"], "blobber_upload_dir"
@@ -222,6 +221,7 @@ class AndroidEmulatorTest(
dirs["abs_test_install_dir"], "xpcshell"
)
work_dir = os.environ.get("MOZ_FETCHES_DIR") or abs_dirs["abs_work_dir"]
+ dirs["abs_xre_dir"] = os.path.join(work_dir, "hostutils")
dirs["abs_sdk_dir"] = os.path.join(work_dir, "android-sdk-linux")
dirs["abs_avds_dir"] = os.path.join(work_dir, "android-device")
dirs["abs_bundletool_path"] = os.path.join(work_dir, "bundletool.jar")
@@ -460,7 +460,7 @@ class AndroidEmulatorTest(
suite_categories=self._query_suite_categories()
)
dirs = self.query_abs_dirs()
- self.xre_path = self.download_hostutils(dirs["abs_xre_dir"])
+ self.xre_path = dirs["abs_xre_dir"]
def install(self):
"""
diff --git a/testing/mozharness/scripts/android_hardware_unittest.py b/testing/mozharness/scripts/android_hardware_unittest.py
index fffccdf2ab..31ae66f3d9 100644
--- a/testing/mozharness/scripts/android_hardware_unittest.py
+++ b/testing/mozharness/scripts/android_hardware_unittest.py
@@ -178,7 +178,6 @@ class AndroidHardwareTest(
dirs["abs_test_bin_dir"] = os.path.join(
abs_dirs["abs_work_dir"], "tests", "bin"
)
- dirs["abs_xre_dir"] = os.path.join(abs_dirs["abs_work_dir"], "hostutils")
dirs["abs_modules_dir"] = os.path.join(dirs["abs_test_install_dir"], "modules")
dirs["abs_blob_upload_dir"] = os.path.join(
abs_dirs["abs_work_dir"], "blobber_upload_dir"
@@ -190,6 +189,8 @@ class AndroidHardwareTest(
dirs["abs_xpcshell_dir"] = os.path.join(
dirs["abs_test_install_dir"], "xpcshell"
)
+ work_dir = os.environ.get("MOZ_FETCHES_DIR") or abs_dirs["abs_work_dir"]
+ dirs["abs_xre_dir"] = os.path.join(work_dir, "hostutils")
for key in dirs.keys():
if key not in abs_dirs:
@@ -390,7 +391,7 @@ class AndroidHardwareTest(
suite_categories=self._query_suite_categories()
)
dirs = self.query_abs_dirs()
- self.xre_path = self.download_hostutils(dirs["abs_xre_dir"])
+ self.xre_path = dirs["abs_xre_dir"]
def install(self):
"""
diff --git a/testing/mozharness/scripts/release/update-verify-config-creator.py b/testing/mozharness/scripts/release/update-verify-config-creator.py
index 9de0175577..7602749c58 100644
--- a/testing/mozharness/scripts/release/update-verify-config-creator.py
+++ b/testing/mozharness/scripts/release/update-verify-config-creator.py
@@ -7,6 +7,7 @@ import math
import os
import pprint
import re
+import subprocess
import sys
from looseversion import LooseVersion
@@ -40,23 +41,23 @@ class CompareVersion(LooseVersion):
LooseVersion(versionMap)
-def is_triangualar(x):
+def is_triangular(x):
"""Check if a number is triangular (0, 1, 3, 6, 10, 15, ...)
see: https://en.wikipedia.org/wiki/Triangular_number#Triangular_roots_and_tests_for_triangular_numbers # noqa
- >>> is_triangualar(0)
+ >>> is_triangular(0)
True
- >>> is_triangualar(1)
+ >>> is_triangular(1)
True
- >>> is_triangualar(2)
+ >>> is_triangular(2)
False
- >>> is_triangualar(3)
+ >>> is_triangular(3)
True
- >>> is_triangualar(4)
+ >>> is_triangular(4)
False
- >>> all(is_triangualar(x) for x in [0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105])
+ >>> all(is_triangular(x) for x in [0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105])
True
- >>> all(not is_triangualar(x) for x in [4, 5, 8, 9, 11, 17, 25, 29, 39, 44, 59, 61, 72, 98, 112])
+ >>> all(not is_triangular(x) for x in [4, 5, 8, 9, 11, 17, 25, 29, 39, 44, 59, 61, 72, 98, 112])
True
"""
# pylint --py3k W1619
@@ -277,6 +278,13 @@ class UpdateVerifyConfigCreator(BaseScript):
"help": "A list of locales to generate full update verify checks for",
},
],
+ [
+ ["--local-repo"],
+ {
+ "dest": "local_repo",
+ "help": "Path to local clone of the repository",
+ },
+ ],
]
def __init__(self):
@@ -353,7 +361,6 @@ class UpdateVerifyConfigCreator(BaseScript):
# we need to use releases_name instead of release_info since esr
# string is included in the name. later we rely on this.
product, version = release_name.split("-", 1)
- tag = "{}_{}_RELEASE".format(product.upper(), version.replace(".", "_"))
# Exclude any releases that don't match one of our include version
# regexes. This is generally to avoid including versions from other
@@ -419,32 +426,11 @@ class UpdateVerifyConfigCreator(BaseScript):
ret = self._retry_download(info_file_url, "WARNING")
buildID = ret.read().split(b"=")[1].strip().decode("utf-8")
- branch = self._get_branch_url(self.config["branch_prefix"], version)
-
- shipped_locales_url = urljoin(
- self.config["hg_server"],
- "{}/raw-file/{}/{}/locales/shipped-locales".format(
- branch,
- tag,
- self.config["app_name"],
- ),
- )
- ret = self._retry_download(shipped_locales_url, "WARNING")
- shipped_locales = ret.read().strip().decode("utf-8")
-
- app_version_url = urljoin(
- self.config["hg_server"],
- "{}/raw-file/{}/{}/config/version.txt".format(
- branch,
- tag,
- self.config["app_name"],
- ),
+ shipped_locales = self._get_file_from_repo_tag(
+ product, version, f"{self.config['app_name']}/locales/shipped-locales"
)
- app_version = (
- self._retry_download(app_version_url, "WARNING")
- .read()
- .strip()
- .decode("utf-8")
+ app_version = self._get_file_from_repo_tag(
+ product, version, f"{self.config['app_name']}/config/version.txt"
)
self.log("Adding {} to update paths".format(version), level=INFO)
@@ -459,6 +445,36 @@ class UpdateVerifyConfigCreator(BaseScript):
if re.match(pattern, version):
self.update_paths[version]["marChannelIds"] = mar_channel_ids
+ def _get_file_from_repo_tag(self, product, version, path):
+ tag = "{}_{}_RELEASE".format(product.upper(), version.replace(".", "_"))
+ branch = self._get_branch_url(self.config["branch_prefix"], version)
+ return self._get_file_from_repo(tag, branch, path)
+
+ def _get_file_from_repo(self, rev, branch, path):
+ if self.config["local_repo"]:
+ try:
+ return (
+ subprocess.check_output(
+ ["hg", "-R", self.config["local_repo"], "cat", "-r", rev, path]
+ )
+ .strip()
+ .decode("utf-8")
+ )
+ except subprocess.CalledProcessError:
+ # the tag may not exist locally
+ pass
+
+ url = urljoin(
+ self.config["hg_server"],
+ "{}/raw-file/{}/{}".format(
+ branch,
+ rev,
+ path,
+ ),
+ )
+ ret = self._retry_download(url, "WARNING")
+ return ret.read().strip().decode("utf-8")
+
def gather_info(self):
from mozilla_version.gecko import GeckoVersion
@@ -520,19 +536,10 @@ class UpdateVerifyConfigCreator(BaseScript):
override_certs=self.config.get("override_certs"),
)
- to_shipped_locales_url = urljoin(
- self.config["hg_server"],
- "{}/raw-file/{}/{}/locales/shipped-locales".format(
- self.config["repo_path"],
- self.config["to_revision"],
- self.config["app_name"],
- ),
- )
- to_shipped_locales = (
- self._retry_download(to_shipped_locales_url, "WARNING")
- .read()
- .strip()
- .decode("utf-8")
+ to_shipped_locales = self._get_file_from_repo(
+ self.config["to_revision"],
+ self.config["repo_path"],
+ "{}/locales/shipped-locales".format(self.config["app_name"]),
)
to_locales = set(
getPlatformLocales(to_shipped_locales, self.config["platform"])
@@ -602,7 +609,7 @@ class UpdateVerifyConfigCreator(BaseScript):
updater_package=updater_package,
)
else:
- if this_full_check_locales and is_triangualar(completes_only_index):
+ if this_full_check_locales and is_triangular(completes_only_index):
self.info("Generating full check configs for %s" % fromVersion)
self.update_verify_config.addRelease(
release=appVersion,
@@ -618,7 +625,7 @@ class UpdateVerifyConfigCreator(BaseScript):
# Quick test for other locales, no download
if len(quick_check_locales) > 0:
self.info("Generating quick check configs for %s" % fromVersion)
- if not is_triangualar(completes_only_index):
+ if not is_triangular(completes_only_index):
# Assuming we skipped full check locales, using all locales
_locales = locales
else:
diff --git a/testing/mozharness/scripts/web_platform_tests.py b/testing/mozharness/scripts/web_platform_tests.py
index e4c3c3983c..4ce679f62d 100755
--- a/testing/mozharness/scripts/web_platform_tests.py
+++ b/testing/mozharness/scripts/web_platform_tests.py
@@ -281,10 +281,10 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
dirs["abs_test_extensions_dir"] = os.path.join(
dirs["abs_test_install_dir"], "extensions"
)
+ work_dir = os.environ.get("MOZ_FETCHES_DIR") or abs_dirs["abs_work_dir"]
if self.is_android:
- dirs["abs_xre_dir"] = os.path.join(abs_dirs["abs_work_dir"], "hostutils")
+ dirs["abs_xre_dir"] = os.path.join(work_dir, "hostutils")
if self.is_emulator:
- work_dir = os.environ.get("MOZ_FETCHES_DIR") or abs_dirs["abs_work_dir"]
dirs["abs_sdk_dir"] = os.path.join(work_dir, "android-sdk-linux")
dirs["abs_avds_dir"] = os.path.join(work_dir, "android-device")
dirs["abs_bundletool_path"] = os.path.join(work_dir, "bundletool.jar")
@@ -377,10 +377,6 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
"--suppress-handler-traceback",
]
- is_windows_7 = (
- mozinfo.info["os"] == "win" and mozinfo.info["os_version"] == "6.1"
- )
-
if self.repeat > 0:
# repeat should repeat the original test, so +1 for first run
cmd.append("--repeat=%s" % (self.repeat + 1))
@@ -390,9 +386,9 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
or mozinfo.info["tsan"]
or "wdspec" in test_types
or not c["disable_fission"]
- # Bug 1392106 - skia error 0x80070005: Access is denied.
- or is_windows_7
- and mozinfo.info["debug"]
+ # reftest on osx needs to be 1 process
+ or "reftest" in test_types
+ and sys.platform.startswith("darwin")
):
processes = 1
else:
@@ -408,11 +404,7 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
else:
cmd += ["--binary=%s" % self.binary_path, "--product=firefox"]
- if is_windows_7:
- # On Windows 7 --install-fonts fails, so fall back to a Firefox-specific codepath
- self._install_fonts()
- else:
- cmd += ["--install-fonts"]
+ cmd += ["--install-fonts"]
for test_type in test_types:
cmd.append("--test-type=%s" % test_type)
@@ -543,7 +535,7 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
)
dirs = self.query_abs_dirs()
if self.is_android:
- self.xre_path = self.download_hostutils(dirs["abs_xre_dir"])
+ self.xre_path = dirs["abs_xre_dir"]
# Make sure that the logging directory exists
if self.mkdir_p(dirs["abs_blob_upload_dir"]) == -1:
self.fatal("Could not create blobber upload directory")