From 4abb0469fd32c59da1af00c90887cabb59dd6e4c Mon Sep 17 00:00:00 2001 From: Raúl Benencia Date: Thu, 4 Jun 2026 13:13:07 -0300 Subject: fix: add min required node version in smoke test --- test/integ-test/frontend_smoke.js | 5 +++++ test/integ-test/integ_test.py | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/test/integ-test/frontend_smoke.js b/test/integ-test/frontend_smoke.js index 0b453c8..e9ac50a 100644 --- a/test/integ-test/frontend_smoke.js +++ b/test/integ-test/frontend_smoke.js @@ -29,6 +29,11 @@ const chromiumBin = process.env.CHROMIUM_BIN || 'chromium'; const smokeMac = '02:00:00:00:00:42'; const smokeMacPath = smokeMac.replace(/:/g, '-'); +const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(Number); +if ((nodeMajor < 22 || (nodeMajor === 22 && nodeMinor < 4)) || typeof WebSocket !== 'function') { + throw new Error('Node >= 22.4.0 with global WebSocket is required for the frontend smoke test'); +} + class CDPClient { constructor(webSocketURL) { this.nextID = 1; diff --git a/test/integ-test/integ_test.py b/test/integ-test/integ_test.py index ca1c90e..a821551 100755 --- a/test/integ-test/integ_test.py +++ b/test/integ-test/integ_test.py @@ -97,6 +97,16 @@ def wait_for_shoelaces(): time.sleep(1) +def check_frontend_node_support(): + supported = subprocess.call(["node", "-e", """ +const [major, minor] = process.versions.node.split('.').map(Number); +process.exit((major > 22 || (major === 22 && minor >= 4)) && typeof WebSocket === 'function' ? 0 : 1); +"""]) == 0 + if not supported: + pytest.skip("node >= 22.4.0 with global WebSocket is required for the frontend smoke test") + + + def test_shoelaces_startup(shoelaces_instance): """ Test API liveness """ wait_for_shoelaces() @@ -114,6 +124,7 @@ def test_frontend_browser_smoke(shoelaces_instance): pytest.skip("node is required for the frontend smoke test") if shutil.which("chromium") is None: pytest.skip("chromium is required for the frontend smoke test") + check_frontend_node_support() wait_for_shoelaces() script = os.path.join(TEST_DIR, "frontend_smoke.js") -- cgit v1.2.3