Bug 1736617 - Use firefox binary in objdir in newtab tests. r=Mardak

Let ./mach npm set FIREFOX_BIN environment variable, for karma-firefox-launcher.

Differential Revision: https://phabricator.services.mozilla.com/D129342
This commit is contained in:
Tooru Fujisawa 2021-10-27 11:07:53 +00:00
parent d766fa0f20
commit 60b9eebf5b

View File

@ -484,6 +484,11 @@ def npm(command_context, args):
path = os.path.abspath(os.path.dirname(npm_path))
os.environ["PATH"] = "{}:{}".format(path, os.environ["PATH"])
# karma-firefox-launcher needs the path to firefox binary.
firefox_bin = command_context.get_binary_path(validate_exists=False)
if os.path.exists(firefox_bin):
os.environ["FIREFOX_BIN"] = firefox_bin
return command_context.run_process(
[npm_path, "--scripts-prepend-node-path=auto"] + args,
pass_thru=True, # Avoid eating npm output/error messages