aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRaúl Benencia <id@rbenencia.name>2026-06-04 13:13:07 -0300
committerRaul Benencia <46945030+raul-te@users.noreply.github.com>2026-06-04 16:54:47 -0300
commit4abb0469fd32c59da1af00c90887cabb59dd6e4c (patch)
treec5d8b15da3fcb7ebd3bb14da9e4dc245386eb7d5 /test
parent1668a8c01763c39dd91c39f98ffe36670ba8c612 (diff)
fix: add min required node version in smoke test
Diffstat (limited to 'test')
-rw-r--r--test/integ-test/frontend_smoke.js5
-rwxr-xr-xtest/integ-test/integ_test.py11
2 files changed, 16 insertions, 0 deletions
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")
nihil fit ex nihilo