Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore lighthouse fix #662

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions wptagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Loading