-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #662 from catchpoint/restore_lighthouse_fix
Restore lighthouse fix
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 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 |
---|---|---|
|
@@ -585,6 +585,10 @@ def startup(self, detected_browsers): | |
if self.get_node_version() < 16.0: | ||
logging.warning("Node.js 16 or newer is required for Lighthouse testing") | ||
|
||
# Force lighthouse 11.4.0 | ||
if self.get_lighthouse_version() != '11.4.0': | ||
subprocess.call(['sudo', 'npm', 'i', '-g', '[email protected]']) | ||
|
||
# Check the iOS install | ||
if self.ios is not None: | ||
ret = self.requires('usbmuxwrapper') and ret | ||
|
@@ -625,6 +629,20 @@ def get_node_version(self): | |
pass | ||
return version | ||
|
||
def get_lighthouse_version(self): | ||
"""Get the installed version of lighthouse""" | ||
version = None | ||
try: | ||
if sys.version_info >= (3, 0): | ||
stdout = subprocess.check_output(['lighthouse', '--version'], encoding='UTF-8') | ||
else: | ||
stdout = subprocess.check_output(['lighthouse', '--version']) | ||
version = stdout.strip() | ||
except Exception: | ||
pass | ||
|
||
return version | ||
|
||
def update_windows_certificates(self): | ||
""" Update the root Windows certificates""" | ||
try: | ||
|