forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1696251 - Replace self with command_context where possible in exi…
…sting mach commands. r=mhentges,webdriver-reviewers,perftest-reviewers,whimboo This step removes all the dependencies of mach commands to having a MachCommandBase as the `self` by using the `command_context` argument instead. This also removes any remaining statefulness from those classes that implement mach commands, ultimately making it easier to move existing commands out of classes in a follow-up. Differential Revision: https://phabricator.services.mozilla.com/D118058
- Loading branch information
Showing
53 changed files
with
1,815 additions
and
1,427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ def valgrind_test(self, command_context, suppressions): | |
from six import string_types | ||
from valgrind.output_handler import OutputHandler | ||
|
||
build_dir = os.path.join(self.topsrcdir, "build") | ||
build_dir = os.path.join(command_context.topsrcdir, "build") | ||
|
||
# XXX: currently we just use the PGO inputs for Valgrind runs. This may | ||
# change in the future. | ||
|
@@ -68,7 +68,9 @@ def valgrind_test(self, command_context, suppressions): | |
|
||
with TemporaryDirectory() as profilePath: | ||
# TODO: refactor this into mozprofile | ||
profile_data_dir = os.path.join(self.topsrcdir, "testing", "profiles") | ||
profile_data_dir = os.path.join( | ||
command_context.topsrcdir, "testing", "profiles" | ||
) | ||
with open(os.path.join(profile_data_dir, "profiles.json"), "r") as fh: | ||
base_profiles = json.load(fh)["valgrind"] | ||
|
||
|
@@ -89,7 +91,7 @@ def valgrind_test(self, command_context, suppressions): | |
prefs[k] = Preferences.cast(v) | ||
|
||
quitter = os.path.join( | ||
self.topsrcdir, "tools", "quitter", "[email protected]" | ||
command_context.topsrcdir, "tools", "quitter", "[email protected]" | ||
) | ||
|
||
locations = ServerLocations() | ||
|
@@ -113,7 +115,7 @@ def valgrind_test(self, command_context, suppressions): | |
env["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1" | ||
env["XPCOM_DEBUG_BREAK"] = "warn" | ||
|
||
outputHandler = OutputHandler(self.log) | ||
outputHandler = OutputHandler(command_context.log) | ||
kp_kwargs = { | ||
"processOutputLine": [outputHandler], | ||
"universal_newlines": True, | ||
|
@@ -171,7 +173,7 @@ def valgrind_test(self, command_context, suppressions): | |
try: | ||
runner = FirefoxRunner( | ||
profile=profile, | ||
binary=self.get_binary_path(), | ||
binary=command_context.get_binary_path(), | ||
cmdargs=firefox_args, | ||
env=env, | ||
process_args=kp_kwargs, | ||
|
@@ -185,7 +187,7 @@ def valgrind_test(self, command_context, suppressions): | |
supps = outputHandler.suppression_count | ||
if errs != supps: | ||
status = 1 # turns the TBPL job orange | ||
self.log( | ||
command_context.log( | ||
logging.ERROR, | ||
"valgrind-fail-parsing", | ||
{"errs": errs, "supps": supps}, | ||
|
@@ -195,7 +197,7 @@ def valgrind_test(self, command_context, suppressions): | |
|
||
elif errs == 0: | ||
status = 0 | ||
self.log( | ||
command_context.log( | ||
logging.INFO, | ||
"valgrind-pass", | ||
{}, | ||
|
@@ -207,21 +209,21 @@ def valgrind_test(self, command_context, suppressions): | |
|
||
if binary_not_found_exception: | ||
status = 2 # turns the TBPL job red | ||
self.log( | ||
command_context.log( | ||
logging.ERROR, | ||
"valgrind-fail-errors", | ||
{"error": str(binary_not_found_exception)}, | ||
"TEST-UNEXPECTED-FAIL | valgrind-test | {error}", | ||
) | ||
self.log( | ||
command_context.log( | ||
logging.INFO, | ||
"valgrind-fail-errors", | ||
{"help": binary_not_found_exception.help()}, | ||
"{help}", | ||
) | ||
elif exitcode is None: | ||
status = 2 # turns the TBPL job red | ||
self.log( | ||
command_context.log( | ||
logging.ERROR, | ||
"valgrind-fail-timeout", | ||
{"timeout": timeout}, | ||
|
@@ -230,7 +232,7 @@ def valgrind_test(self, command_context, suppressions): | |
) | ||
elif exitcode != 0: | ||
status = 2 # turns the TBPL job red | ||
self.log( | ||
command_context.log( | ||
logging.ERROR, | ||
"valgrind-fail-errors", | ||
{"exitcode": exitcode}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.