Skip to content

Commit 5ef2c87

Browse files
authored
Merge pull request catchpoint#662 from catchpoint/restore_lighthouse_fix
Restore lighthouse fix
2 parents 5830f47 + 2af8dc5 commit 5ef2c87

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

wptagent.py

+18
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,10 @@ def startup(self, detected_browsers):
585585
if self.get_node_version() < 16.0:
586586
logging.warning("Node.js 16 or newer is required for Lighthouse testing")
587587

588+
# Force lighthouse 11.4.0
589+
if self.get_lighthouse_version() != '11.4.0':
590+
subprocess.call(['sudo', 'npm', 'i', '-g', '[email protected]'])
591+
588592
# Check the iOS install
589593
if self.ios is not None:
590594
ret = self.requires('usbmuxwrapper') and ret
@@ -625,6 +629,20 @@ def get_node_version(self):
625629
pass
626630
return version
627631

632+
def get_lighthouse_version(self):
633+
"""Get the installed version of lighthouse"""
634+
version = None
635+
try:
636+
if sys.version_info >= (3, 0):
637+
stdout = subprocess.check_output(['lighthouse', '--version'], encoding='UTF-8')
638+
else:
639+
stdout = subprocess.check_output(['lighthouse', '--version'])
640+
version = stdout.strip()
641+
except Exception:
642+
pass
643+
644+
return version
645+
628646
def update_windows_certificates(self):
629647
""" Update the root Windows certificates"""
630648
try:

0 commit comments

Comments
 (0)