Skip to content

Commit

Permalink
Merge pull request #662 from catchpoint/restore_lighthouse_fix
Browse files Browse the repository at this point in the history
Restore lighthouse fix
  • Loading branch information
claud-io committed Apr 18, 2024
2 parents 5830f47 + 2af8dc5 commit 5ef2c87
Showing 1 changed file with 18 additions and 0 deletions.
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', 'lighthouse@11.4.0'])

# 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

0 comments on commit 5ef2c87

Please sign in to comment.