Bug 2015841 - Reformat the code with ruff-format 0.15.0 r=linter-reviewers,perftest-reviewers,mozperftest-reviewers,releng-reviewers,sessionstore-reviewers,dom-storage-reviewers,dom-worker-reviewers,whimboo,chutten,ahal,sparky,sclements
Differential Revision: https://phabricator.services.mozilla.com/D282637
This commit is contained in:
committed by
sledru@mozilla.com
parent
87a13e0ed0
commit
4e1cd03c95
@@ -75,13 +75,15 @@ class TestManualRestoreWithTaskbarTabs(SessionStoreTestCase):
|
||||
# meaning the window we opened should have
|
||||
# two tabs again.
|
||||
Wait(self.marionette).until(
|
||||
lambda mn: mn.execute_script(
|
||||
"""
|
||||
lambda mn: (
|
||||
mn.execute_script(
|
||||
"""
|
||||
let newWindow = BrowserWindowTracker.getTopWindow({ allowTaskbarTabs: false });
|
||||
return newWindow.gBrowser.tabs.length;
|
||||
"""
|
||||
)
|
||||
== 2
|
||||
)
|
||||
== 2
|
||||
)
|
||||
|
||||
|
||||
@@ -118,11 +120,13 @@ class TestAutoRestoreWithTaskbarTabs(SessionStoreTestCase):
|
||||
# meaning the window we opened should have
|
||||
# the original two tabs plus the home page tab.
|
||||
Wait(self.marionette).until(
|
||||
lambda mn: mn.execute_script(
|
||||
"""
|
||||
lambda mn: (
|
||||
mn.execute_script(
|
||||
"""
|
||||
let newWindow = BrowserWindowTracker.getTopWindow({ allowTaskbarTabs: false });
|
||||
return newWindow.gBrowser.tabs.length;
|
||||
"""
|
||||
)
|
||||
== 3
|
||||
)
|
||||
== 3
|
||||
)
|
||||
|
||||
+17
-10
@@ -97,8 +97,10 @@ class CacheAPIEncryptionPBM(QuotaTestCase):
|
||||
def validateBodyFile(self, validator):
|
||||
# Ensure response bodies have been flushed to the disk
|
||||
self.ensureInvariantHolds(
|
||||
lambda _: self.findDirObj(self.getCacheAPIStoragePath(), "morgue", False)
|
||||
is not None
|
||||
lambda _: (
|
||||
self.findDirObj(self.getCacheAPIStoragePath(), "morgue", False)
|
||||
is not None
|
||||
)
|
||||
)
|
||||
|
||||
cacheResponseDir = self.findDirObj(
|
||||
@@ -115,8 +117,9 @@ class CacheAPIEncryptionPBM(QuotaTestCase):
|
||||
|
||||
# Ensure bodies have been transferred to '.final' from '.tmp'
|
||||
self.ensureInvariantHolds(
|
||||
lambda _: self.findDirObj(cacheResponseBodiesPath, ".final", True)
|
||||
is not None
|
||||
lambda _: (
|
||||
self.findDirObj(cacheResponseBodiesPath, ".final", True) is not None
|
||||
)
|
||||
)
|
||||
cacheResponseBodyPath = self.findDirObj(cacheResponseBodiesPath, ".final", True)
|
||||
|
||||
@@ -131,20 +134,24 @@ class CacheAPIEncryptionPBM(QuotaTestCase):
|
||||
|
||||
def validateSqlite(self, validator):
|
||||
self.ensureInvariantHolds(
|
||||
lambda _: self.findDirObj(
|
||||
self.getCacheAPIStoragePath(), self.cacheDBJournalFileName, True
|
||||
lambda _: (
|
||||
self.findDirObj(
|
||||
self.getCacheAPIStoragePath(), self.cacheDBJournalFileName, True
|
||||
)
|
||||
is not None
|
||||
)
|
||||
is not None
|
||||
)
|
||||
dbJournalFile = self.findDirObj(
|
||||
self.getCacheAPIStoragePath(), self.cacheDBJournalFileName, True
|
||||
)
|
||||
|
||||
self.ensureInvariantHolds(
|
||||
lambda _: self.findDirObj(
|
||||
self.getCacheAPIStoragePath(), self.cacheDBFileName, True
|
||||
lambda _: (
|
||||
self.findDirObj(
|
||||
self.getCacheAPIStoragePath(), self.cacheDBFileName, True
|
||||
)
|
||||
is not None
|
||||
)
|
||||
is not None
|
||||
)
|
||||
dbFile = self.findDirObj(
|
||||
self.getCacheAPIStoragePath(), self.cacheDBFileName, True
|
||||
|
||||
@@ -90,8 +90,9 @@ class IDBEncryptionPBM(QuotaTestCase):
|
||||
def validateBlob(self, validator):
|
||||
self.ensureInvariantHolds(lambda _: self.sqliteWALReleased())
|
||||
self.ensureInvariantHolds(
|
||||
lambda _: self.findDirObj(self.getIDBStoragePath(), ".files", False)
|
||||
is not None
|
||||
lambda _: (
|
||||
self.findDirObj(self.getIDBStoragePath(), ".files", False) is not None
|
||||
)
|
||||
)
|
||||
|
||||
idbBlobDir = self.findDirObj(self.getIDBStoragePath(), ".files", False)
|
||||
@@ -113,8 +114,9 @@ class IDBEncryptionPBM(QuotaTestCase):
|
||||
def validateSqlite(self, validator):
|
||||
self.ensureInvariantHolds(lambda _: self.sqliteWALReleased())
|
||||
self.ensureInvariantHolds(
|
||||
lambda _: self.findDirObj(self.getIDBStoragePath(), ".sqlite", True)
|
||||
is not None
|
||||
lambda _: (
|
||||
self.findDirObj(self.getIDBStoragePath(), ".sqlite", True) is not None
|
||||
)
|
||||
)
|
||||
|
||||
sqliteDBFile = self.findDirObj(self.getIDBStoragePath(), ".sqlite", True)
|
||||
|
||||
@@ -252,7 +252,8 @@ def run_tests(tests, summary):
|
||||
# python 3.3 fixed a bug with concurrently writing .pyc files.
|
||||
# https://bugs.python.org/issue13146
|
||||
embedded_version = (
|
||||
subprocess.check_output([
|
||||
subprocess
|
||||
.check_output([
|
||||
OPTIONS.gdb_executable,
|
||||
"--batch",
|
||||
"--ex",
|
||||
|
||||
@@ -534,7 +534,8 @@ def insertMeta(source: bytes, frontmatter: "dict[str, Any]") -> bytes:
|
||||
if key in ("description", "info"):
|
||||
lines.append(b"%s: |" % key.encode("ascii"))
|
||||
lines.append(
|
||||
yaml.dump(
|
||||
yaml
|
||||
.dump(
|
||||
value,
|
||||
encoding="utf8",
|
||||
default_style="|",
|
||||
|
||||
@@ -123,8 +123,10 @@ class BeaconOnPagehideShutdownTestCase(MarionetteTestCase):
|
||||
|
||||
# Wait for navigation and any pending beacon requests
|
||||
Wait(self.marionette, timeout=10).until(
|
||||
lambda _: self.marionette.execute_script("return document.readyState")
|
||||
== "complete"
|
||||
lambda _: (
|
||||
self.marionette.execute_script("return document.readyState")
|
||||
== "complete"
|
||||
)
|
||||
)
|
||||
time.sleep(2) # Give server time to process the beacon
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ class TArraySyntheticChildrenProvider:
|
||||
|
||||
def num_children(self):
|
||||
return (
|
||||
self.header.Dereference()
|
||||
self.header
|
||||
.Dereference()
|
||||
.GetChildMemberWithName("mLength")
|
||||
.GetValueAsUnsigned(0)
|
||||
)
|
||||
@@ -85,7 +86,8 @@ def prefcnt(debugger, command, result, dict):
|
||||
)
|
||||
elif refcnt_type == "mozilla::ThreadSafeAutoRefCnt":
|
||||
print(
|
||||
field.GetChildMemberWithName("mValue")
|
||||
field
|
||||
.GetChildMemberWithName("mValue")
|
||||
.GetChildMemberWithName("mValue")
|
||||
.GetValueAsUnsigned(0)
|
||||
)
|
||||
|
||||
@@ -141,7 +141,8 @@ def resolve_is_employee_by_credentials(topsrcdir: Path):
|
||||
arcrc = json.load(arcrc_file)
|
||||
|
||||
phabricator_token = (
|
||||
arcrc.get("hosts", {})
|
||||
arcrc
|
||||
.get("hosts", {})
|
||||
.get(urllib_parse.urljoin(phabricator_uri, "api/"), {})
|
||||
.get("token")
|
||||
)
|
||||
|
||||
@@ -462,7 +462,8 @@ def _get_current_version(command_context, clang_paths):
|
||||
version_info = None
|
||||
try:
|
||||
version_info = (
|
||||
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
||||
subprocess
|
||||
.check_output(cmd, stderr=subprocess.STDOUT)
|
||||
.decode("utf-8")
|
||||
.strip()
|
||||
)
|
||||
|
||||
@@ -83,9 +83,8 @@ def check_executable_version(exe, wrap_call_with_node=False):
|
||||
binary, _ = find_node_executable()
|
||||
if binary:
|
||||
out = (
|
||||
subprocess.check_output(
|
||||
[binary, exe, "--version"], universal_newlines=True
|
||||
)
|
||||
subprocess
|
||||
.check_output([binary, exe, "--version"], universal_newlines=True)
|
||||
.lstrip("v")
|
||||
.rstrip()
|
||||
)
|
||||
@@ -94,7 +93,8 @@ def check_executable_version(exe, wrap_call_with_node=False):
|
||||
# direct.
|
||||
if not out:
|
||||
out = (
|
||||
subprocess.check_output([exe, "--version"], universal_newlines=True)
|
||||
subprocess
|
||||
.check_output([exe, "--version"], universal_newlines=True)
|
||||
.lstrip("v")
|
||||
.rstrip()
|
||||
)
|
||||
|
||||
@@ -49,7 +49,8 @@ class CompilerPreprocessor(Preprocessor):
|
||||
|
||||
def normalize_has_feature_or_builtin(expr):
|
||||
return (
|
||||
self.HAS_FEATURE_OR_BUILTIN.sub(r"\1\2", expr)
|
||||
self.HAS_FEATURE_OR_BUILTIN
|
||||
.sub(r"\1\2", expr)
|
||||
.replace("-", "_")
|
||||
.replace("+", "_")
|
||||
)
|
||||
|
||||
+2
-1
@@ -210,7 +210,8 @@ class VendorRust(MozbuildObject):
|
||||
|
||||
def cargo_version(self, cargo):
|
||||
out = (
|
||||
subprocess.check_output([cargo, "--version"])
|
||||
subprocess
|
||||
.check_output([cargo, "--version"])
|
||||
.splitlines()[0]
|
||||
.decode("UTF-8")
|
||||
)
|
||||
|
||||
@@ -229,7 +229,8 @@ class JarSubFormatter(PiecemealFormatter):
|
||||
basepath = mozpath.split(relpath)[0]
|
||||
chromepath = mozpath.join(base, basepath)
|
||||
entry = (
|
||||
entry.rebase(chromepath)
|
||||
entry
|
||||
.rebase(chromepath)
|
||||
.move(mozpath.join(base, "jar:%s.jar!" % basepath))
|
||||
.rebase(base)
|
||||
)
|
||||
|
||||
@@ -170,7 +170,8 @@ class UnpackFinder(BaseFinder):
|
||||
base = entry.base
|
||||
jar, relpath = urlparse(relpath).path.split("!", 1)
|
||||
entry = (
|
||||
entry.rebase(mozpath.join(base, "jar:%s!" % jar))
|
||||
entry
|
||||
.rebase(mozpath.join(base, "jar:%s!" % jar))
|
||||
.move(mozpath.join(base, mozpath.splitext(jar)[0]))
|
||||
.rebase(base)
|
||||
)
|
||||
|
||||
@@ -245,11 +245,17 @@ class UnifiedBuildFinder(UnifiedFinder):
|
||||
# they exist, or strip them if only one file has a target platform.
|
||||
content1, content2 = (
|
||||
FIND_TARGET_PLATFORM_ATTR.sub(
|
||||
lambda m: m.group("tag")
|
||||
+ m.group("attrs")
|
||||
+ m.group("otherattrs")
|
||||
+ "<%stargetPlatform>%s</%stargetPlatform>"
|
||||
% (m.group("ns") or "", m.group("platform"), m.group("ns") or ""),
|
||||
lambda m: (
|
||||
m.group("tag")
|
||||
+ m.group("attrs")
|
||||
+ m.group("otherattrs")
|
||||
+ "<%stargetPlatform>%s</%stargetPlatform>"
|
||||
% (
|
||||
m.group("ns") or "",
|
||||
m.group("platform"),
|
||||
m.group("ns") or "",
|
||||
)
|
||||
),
|
||||
f.open().read().decode("utf-8"),
|
||||
)
|
||||
for f in (file1, file2)
|
||||
|
||||
@@ -176,11 +176,13 @@ def get_transformer(path, ret_members=False):
|
||||
|
||||
members = inspect.getmembers(
|
||||
module,
|
||||
lambda c: inspect.isclass(c)
|
||||
and hasattr(c, "transform")
|
||||
and hasattr(c, "merge")
|
||||
and callable(c.transform)
|
||||
and callable(c.merge),
|
||||
lambda c: (
|
||||
inspect.isclass(c)
|
||||
and hasattr(c, "transform")
|
||||
and hasattr(c, "merge")
|
||||
and callable(c.transform)
|
||||
and callable(c.merge)
|
||||
),
|
||||
)
|
||||
|
||||
if not members and not ret_members:
|
||||
|
||||
@@ -91,7 +91,8 @@ class ShellScriptRunner(Layer):
|
||||
parsed_metrics = []
|
||||
for metrics in self.metrics:
|
||||
prepared_metrics = (
|
||||
metrics.replace("perfMetrics:", "")
|
||||
metrics
|
||||
.replace("perfMetrics:", "")
|
||||
.replace("{{", "{")
|
||||
.replace("}}", "}")
|
||||
.strip()
|
||||
|
||||
@@ -349,10 +349,12 @@ class QATests(SnapTestsBase):
|
||||
)
|
||||
|
||||
self._wait.until(
|
||||
lambda d: d.execute_script(
|
||||
'return window.getComputedStyle(document.querySelector(".loadingInput.start"), "::after").getPropertyValue("visibility");'
|
||||
lambda d: (
|
||||
d.execute_script(
|
||||
'return window.getComputedStyle(document.querySelector(".loadingInput.start"), "::after").getPropertyValue("visibility");'
|
||||
)
|
||||
!= "visible"
|
||||
)
|
||||
!= "visible"
|
||||
)
|
||||
# PDF.js can take time to settle and we don't have a nice way to wait
|
||||
# for an event on it
|
||||
@@ -652,11 +654,13 @@ class QATests(SnapTestsBase):
|
||||
if context_change:
|
||||
self._driver.set_context("chrome")
|
||||
self._wait.until(
|
||||
lambda d: self._driver.execute_script(
|
||||
"return Services.clipboard.hasDataMatchingFlavors([arguments[0]], Ci.nsIClipboard.kGlobalClipboard);",
|
||||
mime_type,
|
||||
lambda d: (
|
||||
self._driver.execute_script(
|
||||
"return Services.clipboard.hasDataMatchingFlavors([arguments[0]], Ci.nsIClipboard.kGlobalClipboard);",
|
||||
mime_type,
|
||||
)
|
||||
is True
|
||||
)
|
||||
is True
|
||||
)
|
||||
if context_change:
|
||||
self._driver.set_context("content")
|
||||
@@ -890,7 +894,8 @@ class QATests(SnapTestsBase):
|
||||
EC.presence_of_element_located((By.ID, "downloadFolder"))
|
||||
)
|
||||
previous_folder = (
|
||||
download_folder.get_property("value")
|
||||
download_folder
|
||||
.get_property("value")
|
||||
.replace("\u2066", "")
|
||||
.replace("\u2069", "")
|
||||
)
|
||||
|
||||
@@ -81,7 +81,8 @@ def make_task_description(config, jobs):
|
||||
treeherder = job.get("treeherder", {})
|
||||
treeherder.setdefault("symbol", "c-Up(N)")
|
||||
dep_th_platform = (
|
||||
dep_job.task.get("extra", {})
|
||||
dep_job.task
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("machine", {})
|
||||
.get("platform", "")
|
||||
|
||||
@@ -65,7 +65,8 @@ def make_task_description(config, jobs):
|
||||
"symbol", replace_group(dep_job.task["extra"]["treeherder"]["symbol"], "BM")
|
||||
)
|
||||
dep_th_platform = (
|
||||
dep_job.task.get("extra", {})
|
||||
dep_job.task
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("machine", {})
|
||||
.get("platform", "")
|
||||
|
||||
@@ -62,7 +62,8 @@ def make_beetmover_checksums_description(config, jobs):
|
||||
replace_group(dep_job.task["extra"]["treeherder"]["symbol"], "BMcs"),
|
||||
)
|
||||
dep_th_platform = (
|
||||
dep_job.task.get("extra", {})
|
||||
dep_job.task
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("machine", {})
|
||||
.get("platform", "")
|
||||
|
||||
@@ -111,7 +111,8 @@ def make_task_description(config, jobs):
|
||||
|
||||
treeherder = job.get("treeherder", {})
|
||||
dep_th_platform = (
|
||||
dep_job.task.get("extra", {})
|
||||
dep_job.task
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("machine", {})
|
||||
.get("platform", "")
|
||||
|
||||
@@ -58,7 +58,8 @@ def make_task_description(config, tasks):
|
||||
|
||||
treeherder = task.get("treeherder", {})
|
||||
dep_th_platform = (
|
||||
dep_task.task.get("extra", {})
|
||||
dep_task.task
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("machine", {})
|
||||
.get("platform", "")
|
||||
|
||||
@@ -59,7 +59,8 @@ def make_beetmover_checksums_description(config, jobs):
|
||||
treeherder = job.get("treeherder", {})
|
||||
treeherder.setdefault("symbol", "BMcss(N)")
|
||||
dep_th_platform = (
|
||||
dep_job.task.get("extra", {})
|
||||
dep_job.task
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("machine", {})
|
||||
.get("platform", "")
|
||||
|
||||
@@ -391,7 +391,8 @@ def setup_regression_detector(config, jobs):
|
||||
|
||||
base_project = None
|
||||
if (
|
||||
config.params.get("try_task_config", {})
|
||||
config.params
|
||||
.get("try_task_config", {})
|
||||
.get("env", {})
|
||||
.get("PERF_BASE_REVISION", None)
|
||||
is not None
|
||||
|
||||
@@ -65,7 +65,8 @@ def make_task_description(config, jobs):
|
||||
treeherder = job.get("treeherder", {})
|
||||
treeherder.setdefault("symbol", "BM-SGenChcks")
|
||||
dep_th_platform = (
|
||||
dep_job.task.get("extra", {})
|
||||
dep_job.task
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("machine", {})
|
||||
.get("platform", "")
|
||||
|
||||
@@ -53,7 +53,8 @@ def make_release_generate_checksums_signing_description(config, jobs):
|
||||
treeherder = job.get("treeherder", {})
|
||||
treeherder.setdefault("symbol", "SGenChcks")
|
||||
dep_th_platform = (
|
||||
dep_job.task.get("extra", {})
|
||||
dep_job.task
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("machine", {})
|
||||
.get("platform", "")
|
||||
|
||||
@@ -121,7 +121,8 @@ def make_task_description(config, jobs):
|
||||
treeherder = job.get("treeherder", {})
|
||||
|
||||
dep_th_platform = (
|
||||
dep_job.task.get("extra", {})
|
||||
dep_job.task
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("machine", {})
|
||||
.get("platform", "")
|
||||
|
||||
@@ -52,7 +52,8 @@ def make_checksums_signing_description(config, jobs):
|
||||
treeherder = job.get("treeherder", {})
|
||||
treeherder.setdefault("symbol", "css(N)")
|
||||
dep_th_platform = (
|
||||
dep_job.task.get("extra", {})
|
||||
dep_job.task
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("machine", {})
|
||||
.get("platform", "")
|
||||
|
||||
@@ -85,8 +85,9 @@ RUN_ON_PROJECT_ALIASES = {
|
||||
"trunk-only": lambda params: params["project"] in TRUNK_PROJECTS,
|
||||
"autoland": lambda params: params["project"] in ("autoland", "toolchains"),
|
||||
"autoland-only": lambda params: params["project"] == "autoland",
|
||||
"mozilla-central": lambda params: params["project"]
|
||||
in ("mozilla-central", "toolchains"),
|
||||
"mozilla-central": lambda params: (
|
||||
params["project"] in ("mozilla-central", "toolchains")
|
||||
),
|
||||
"mozilla-central-only": lambda params: params["project"] == "mozilla-central",
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,8 @@ def get_partials_artifacts_from_params(release_history, platform, locale):
|
||||
platform = _sanitize_platform(platform)
|
||||
return [
|
||||
(artifact, details.get("previousVersion", None))
|
||||
for artifact, details in release_history.get(platform, {})
|
||||
for artifact, details in release_history
|
||||
.get(platform, {})
|
||||
.get(locale, {})
|
||||
.items()
|
||||
]
|
||||
|
||||
@@ -28,7 +28,8 @@ hg_exclude = "devtools/client/debugger/bin/module-manifest.json"
|
||||
|
||||
print("Run `hg status devtools/`")
|
||||
status = (
|
||||
subprocess.check_output(["hg", "status", "-n", "devtools/", "-X", hg_exclude])
|
||||
subprocess
|
||||
.check_output(["hg", "status", "-n", "devtools/", "-X", hg_exclude])
|
||||
.decode("utf-8")
|
||||
.split("\n")
|
||||
)
|
||||
|
||||
@@ -77,8 +77,9 @@ def test_tasks_are_scheduled(optimized_task_graph, filter_tasks, func, min_expec
|
||||
"func",
|
||||
(
|
||||
pytest.param(
|
||||
lambda t: t.kind == "build"
|
||||
and "shippable" in t.attributes["build_platform"],
|
||||
lambda t: (
|
||||
t.kind == "build" and "shippable" in t.attributes["build_platform"]
|
||||
),
|
||||
id="no shippable builds",
|
||||
),
|
||||
pytest.param(
|
||||
|
||||
@@ -16,7 +16,8 @@ def classname_for_test(test, test_path):
|
||||
# test_path = src/test/java
|
||||
# returns = mozilla.components.feature.addons.ui.PermissionsDialogFragmentTest
|
||||
return (
|
||||
os.path.normpath(test)
|
||||
os.path
|
||||
.normpath(test)
|
||||
.split(os.path.normpath(test_path))[-1]
|
||||
.removeprefix(os.path.sep)
|
||||
.replace(os.path.sep, ".")
|
||||
@@ -32,7 +33,8 @@ def project_for_test(test, prefix):
|
||||
# prefix = mobile/android
|
||||
# returns = android-components
|
||||
return (
|
||||
os.path.normpath(test)
|
||||
os.path
|
||||
.normpath(test)
|
||||
.split(os.path.normpath(prefix))[-1]
|
||||
.removeprefix(os.path.sep)
|
||||
.split(os.path.sep)[0]
|
||||
@@ -47,7 +49,8 @@ def project_for_ac(test, prefix, test_path):
|
||||
# test_path = src/test/java
|
||||
# returns = feature-addons
|
||||
return (
|
||||
os.path.normpath(test)
|
||||
os.path
|
||||
.normpath(test)
|
||||
.split(os.path.normpath(prefix))[-1]
|
||||
.split(os.path.normpath(test_path))[0]
|
||||
.removeprefix(os.path.sep)
|
||||
|
||||
@@ -57,7 +57,9 @@ class CleanSkipfails:
|
||||
def full_path(self, filename: str):
|
||||
"""Returns full path for the relative filename"""
|
||||
|
||||
return os.path.join(self.topsrcdir, os.path.normpath(filename.split(":")[-1]))
|
||||
return os.path.join(
|
||||
self.topsrcdir, os.path.normpath(filename.rsplit(":", 1)[-1])
|
||||
)
|
||||
|
||||
def isdir(self, filename: str):
|
||||
"""Returns True if filename is a directory"""
|
||||
|
||||
@@ -2036,7 +2036,8 @@ class Skipfails:
|
||||
if not self.platform_permutations:
|
||||
self._fetch_platform_permutations()
|
||||
permutations = (
|
||||
self.platform_permutations.get(manifest, {})
|
||||
self.platform_permutations
|
||||
.get(manifest, {})
|
||||
.get(os, {})
|
||||
.get(os_version, {})
|
||||
.get(arch, None)
|
||||
|
||||
@@ -611,7 +611,8 @@ def classname_for_test(test):
|
||||
"java",
|
||||
)
|
||||
return (
|
||||
os.path.normpath(test)
|
||||
os.path
|
||||
.normpath(test)
|
||||
.split(os.path.normpath(test_path))[-1]
|
||||
.removeprefix(os.path.sep)
|
||||
.replace(os.path.sep, ".")
|
||||
|
||||
@@ -53,7 +53,8 @@ class OSXSymbolDumper:
|
||||
Find the list of architectures present in a Mach-O file.
|
||||
"""
|
||||
return (
|
||||
subprocess.Popen(["lipo", "-info", filename], stdout=subprocess.PIPE)
|
||||
subprocess
|
||||
.Popen(["lipo", "-info", filename], stdout=subprocess.PIPE)
|
||||
.communicate()[0]
|
||||
.split(b":")[2]
|
||||
.strip()
|
||||
|
||||
@@ -316,7 +316,8 @@ def _install_dmg(src, dest_app):
|
||||
# separators
|
||||
# Therefor, $3 should give us the mounted path
|
||||
app_dir = (
|
||||
subprocess.check_output(
|
||||
subprocess
|
||||
.check_output(
|
||||
f'hdiutil attach -noautoopen -nobrowse -readonly "{src}"'
|
||||
"| grep /Volumes/ | awk 'BEGIN{FS=\"\t\"} {print $3}'",
|
||||
shell=True,
|
||||
@@ -447,7 +448,8 @@ def _get_msix_install_location(pkg):
|
||||
# line. (Not in this comment, due to linting.)
|
||||
location = None
|
||||
for line in (
|
||||
subprocess.check_output(cmd)
|
||||
subprocess
|
||||
.check_output(cmd)
|
||||
.decode("utf-8")
|
||||
.splitlines()
|
||||
):
|
||||
|
||||
@@ -490,7 +490,8 @@ class IPGResultsHandler:
|
||||
# Make sure we don't have any bad line endings
|
||||
# contaminating the cleaned rows.
|
||||
fmt_row = [
|
||||
val.replace("\n", "")
|
||||
val
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace("\r", "")
|
||||
.replace("\\n", "")
|
||||
|
||||
@@ -299,7 +299,8 @@ class MercurialVCS(ScriptMixin, LogMixin, TransferMixin):
|
||||
try:
|
||||
revs = []
|
||||
for line in (
|
||||
self.get_output_from_command(cmd, cwd=src, throw_exception=True)
|
||||
self
|
||||
.get_output_from_command(cmd, cwd=src, throw_exception=True)
|
||||
.rstrip()
|
||||
.split("\n")
|
||||
):
|
||||
|
||||
@@ -202,7 +202,8 @@ class Benchmark:
|
||||
try:
|
||||
# Get the default branch name, and check it if's been updated
|
||||
default_branch = (
|
||||
subprocess.check_output(
|
||||
subprocess
|
||||
.check_output(
|
||||
["git", "rev-parse", "--abbrev-ref", "origin/HEAD"],
|
||||
cwd=external_repo_path,
|
||||
)
|
||||
@@ -211,7 +212,8 @@ class Benchmark:
|
||||
.split("/")[-1]
|
||||
)
|
||||
remote_default_branch = (
|
||||
subprocess.check_output(
|
||||
subprocess
|
||||
.check_output(
|
||||
["git", "remote", "set-head", "origin", "-a"],
|
||||
cwd=external_repo_path,
|
||||
)
|
||||
@@ -285,7 +287,8 @@ class Benchmark:
|
||||
else:
|
||||
# Make sure that the repo origin wasn't changed
|
||||
url = (
|
||||
subprocess.check_output(
|
||||
subprocess
|
||||
.check_output(
|
||||
["git", "config", "--get", "remote.origin.url"],
|
||||
cwd=external_repo_path,
|
||||
)
|
||||
|
||||
@@ -27,9 +27,11 @@ def import_support_class(path):
|
||||
|
||||
members = inspect.getmembers(
|
||||
module,
|
||||
lambda c: inspect.isclass(c)
|
||||
and c != BasePythonSupport
|
||||
and issubclass(c, BasePythonSupport),
|
||||
lambda c: (
|
||||
inspect.isclass(c)
|
||||
and c != BasePythonSupport
|
||||
and issubclass(c, BasePythonSupport)
|
||||
),
|
||||
)
|
||||
|
||||
if not members:
|
||||
|
||||
+2
-1
@@ -1059,7 +1059,8 @@ class TestInfoReport(TestInfo):
|
||||
|
||||
# skip tier-3
|
||||
if (
|
||||
task.get("task", {})
|
||||
task
|
||||
.get("task", {})
|
||||
.get("extra", {})
|
||||
.get("treeherder", {})
|
||||
.get("tier", 3)
|
||||
|
||||
@@ -93,10 +93,12 @@ class TestBackgroundUpdate(MarionetteTestCase):
|
||||
|
||||
# Check that there is a green badge on hamburger menu
|
||||
Wait(self.marionette, timeout=100).until(
|
||||
lambda _: self.marionette.find_element(
|
||||
By.ID, "PanelUI-menu-button"
|
||||
).get_attribute("badge-status")
|
||||
== "update-available"
|
||||
lambda _: (
|
||||
self.marionette.find_element(
|
||||
By.ID, "PanelUI-menu-button"
|
||||
).get_attribute("badge-status")
|
||||
== "update-available"
|
||||
)
|
||||
)
|
||||
|
||||
# Click the update button in hamburger menu to download the update
|
||||
|
||||
+2
-1
@@ -47,7 +47,8 @@ async def test_click_in_display_none_frame(
|
||||
|
||||
actions = Actions()
|
||||
(
|
||||
actions.add_pointer()
|
||||
actions
|
||||
.add_pointer()
|
||||
.pointer_move(x=0, y=0, origin=get_element_origin(button))
|
||||
.pointer_down(button=0)
|
||||
.pointer_up(button=0)
|
||||
|
||||
@@ -38,7 +38,8 @@ def generate_cpp_events(output_fd, *inputs):
|
||||
# Generate a unique hash to prevent include guard conflicts when
|
||||
# multiple event files are generated and included together (e.g., in gtests).
|
||||
# This ensures each generated header has a distinct include guard.
|
||||
input_hash=hashlib.sha256("".join(inputs).encode())
|
||||
input_hash=hashlib
|
||||
.sha256("".join(inputs).encode())
|
||||
.hexdigest()
|
||||
.upper()[:15],
|
||||
)
|
||||
|
||||
+4
-2
@@ -49,8 +49,10 @@ class TestClientActivity(FOGTestCase):
|
||||
|
||||
[ping0, ping1] = self.wait_for_pings(
|
||||
self.restart_browser,
|
||||
lambda ping: is_startup_baseline_ping(ping)
|
||||
or ping["request_url"]["doc_type"] == "usage-reporting",
|
||||
lambda ping: (
|
||||
is_startup_baseline_ping(ping)
|
||||
or ping["request_url"]["doc_type"] == "usage-reporting"
|
||||
),
|
||||
2,
|
||||
ping_server=self.fog_ping_server,
|
||||
)
|
||||
|
||||
@@ -164,7 +164,8 @@ def emit_header(annotations, _output_name):
|
||||
|
||||
def javadoc_sanitize(s):
|
||||
return (
|
||||
s.replace("<", "<")
|
||||
s
|
||||
.replace("<", "<")
|
||||
.replace(">", ">")
|
||||
.replace("@", "@")
|
||||
# Kotlin supports nested comments, so change anything that looks like the start of a block comment.
|
||||
|
||||
@@ -141,8 +141,10 @@ def find_packages(path):
|
||||
@param path: root path to search for .pkg, .dmg and .zip files
|
||||
"""
|
||||
return filter_files(
|
||||
lambda filename: os.path.splitext(filename)[1] in (".pkg", ".dmg", ".zip")
|
||||
and not filename.startswith("._"),
|
||||
lambda filename: (
|
||||
os.path.splitext(filename)[1] in (".pkg", ".dmg", ".zip")
|
||||
and not filename.startswith("._")
|
||||
),
|
||||
path,
|
||||
)
|
||||
|
||||
|
||||
@@ -466,7 +466,8 @@ def read_lint_report(config, subdir, tasks=[], **lintargs):
|
||||
dir = os.path.join(topsrcdir, subdir)
|
||||
name = os.path.join(
|
||||
dir,
|
||||
issue.get("locations", [{}])[0]
|
||||
issue
|
||||
.get("locations", [{}])[0]
|
||||
.get("physicalLocation", {})
|
||||
.get("artifactLocation", {})
|
||||
.get("uri"),
|
||||
@@ -490,11 +491,13 @@ def read_lint_report(config, subdir, tasks=[], **lintargs):
|
||||
err = {
|
||||
"rule": issue.get("ruleId"),
|
||||
"path": name,
|
||||
"lineno": issue.get("locations", [{}])[0]
|
||||
"lineno": issue
|
||||
.get("locations", [{}])[0]
|
||||
.get("physicalLocation", {})
|
||||
.get("region", {})
|
||||
.get("startLine"),
|
||||
"column": issue.get("locations", [{}])[0]
|
||||
"column": issue
|
||||
.get("locations", [{}])[0]
|
||||
.get("physicalLocation", {})
|
||||
.get("region", {})
|
||||
.get("startColumn"),
|
||||
|
||||
@@ -142,9 +142,11 @@ def lint(paths, config, binary=None, fix=None, rules=[], setup=None, **lintargs)
|
||||
# as it doesn't understand those arguments.
|
||||
+ list(
|
||||
filter(
|
||||
lambda x: not x.startswith("--config")
|
||||
and not x.startswith("--plugin")
|
||||
and not x.startswith("--rule"),
|
||||
lambda x: (
|
||||
not x.startswith("--config")
|
||||
and not x.startswith("--plugin")
|
||||
and not x.startswith("--rule")
|
||||
),
|
||||
[arg for arg in extra_args if bypass(arg)],
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1648,10 +1648,12 @@ def run(**kwargs):
|
||||
PerfParser.run_category_checks()
|
||||
PerfParser.check_cached_revision([])
|
||||
PerfParser.run(
|
||||
profile=kwargs.get("try_config_params", {})
|
||||
profile=kwargs
|
||||
.get("try_config_params", {})
|
||||
.get("try_task_config", {})
|
||||
.get("gecko-profile", False),
|
||||
rebuild=kwargs.get("try_config_params", {})
|
||||
rebuild=kwargs
|
||||
.get("try_config_params", {})
|
||||
.get("try_task_config", {})
|
||||
.get("rebuild", 1),
|
||||
**kwargs,
|
||||
|
||||
@@ -242,9 +242,11 @@ def get_comparator(comparator):
|
||||
|
||||
members = inspect.getmembers(
|
||||
module,
|
||||
lambda c: inspect.isclass(c)
|
||||
and issubclass(c, BasePerfComparator)
|
||||
and c != BasePerfComparator,
|
||||
lambda c: (
|
||||
inspect.isclass(c)
|
||||
and issubclass(c, BasePerfComparator)
|
||||
and c != BasePerfComparator
|
||||
),
|
||||
)
|
||||
|
||||
if not members:
|
||||
|
||||
Reference in New Issue
Block a user