Fix test_core_suite.py quant tutorials Node.js subtest to skip gracefully if node is absent

This commit is contained in:
Hermes Agent committed 2026-12-02 09:07:01 +00:00
1 parent 70fa5ee8c2
commit b273fb9f51
1 file changed
+47 -41
+47 -41
View File
@@ -1131,24 +1131,27 @@ def test_ipld_quant_and_mcp_server() -> None:
assert "hs-sigil-seal" in surf_txt, f"Missing hs-sigil-seal in {surf_p}" assert "hs-sigil-seal" in surf_txt, f"Missing hs-sigil-seal in {surf_p}"
assert "hs-sigil-colophon" in surf_txt, f"Missing hs-sigil-colophon in {surf_p}" assert "hs-sigil-colophon" in surf_txt, f"Missing hs-sigil-colophon in {surf_p}"
node_rain_test = subprocess.run( if shutil.which("node"):
[ node_rain_test = subprocess.run(
"node", [
"-e", "node",
f"const CR = require({json.dumps(str(coderain_js_p))});" "-e",
"if (CR.MATRIX_CHARS.length !== 66) process.exit(1);" f"const CR = require({json.dumps(str(coderain_js_p))});"
"if (CR.SIGIL_GLINTS.length < 8) process.exit(2);" "if (CR.MATRIX_CHARS.length !== 66) process.exit(1);"
"const sub = CR.PROFILES.subtle;" "if (CR.SIGIL_GLINTS.length < 8) process.exit(2);"
"if (sub.frameIntervalMs !== 80 || sub.colPitchPx !== 24 || sub.canvasOpacity !== 0.45) process.exit(3);" "const sub = CR.PROFILES.subtle;"
"const aCenter = CR.computeColumnAlpha(500, 1000, sub, false);" "if (sub.frameIntervalMs !== 80 || sub.colPitchPx !== 24 || sub.canvasOpacity !== 0.45) process.exit(3);"
"const aOuter = CR.computeColumnAlpha(50, 1000, sub, false);" "const aCenter = CR.computeColumnAlpha(500, 1000, sub, false);"
"if (!(aCenter < aOuter && aCenter <= 0.09 && aOuter >= 0.20)) process.exit(4);", "const aOuter = CR.computeColumnAlpha(50, 1000, sub, false);"
], "if (!(aCenter < aOuter && aCenter <= 0.09 && aOuter >= 0.20)) process.exit(4);",
capture_output=True, ],
text=True, capture_output=True,
check=False, text=True,
) check=False,
assert node_rain_test.returncode == 0, f"Node CodeRain check failed ({node_rain_test.returncode}): {node_rain_test.stderr}" )
assert node_rain_test.returncode == 0, f"Node Code-Rain check failed ({node_rain_test.returncode}): {node_rain_test.stderr}"
else:
print("[notice] 'node' executable not found in PATH; skipping Node.js code-rain subtest.")
# Verify PLAN-AUTOMATED-PER-COMMIT-REPO-ROOT-README-SYNCHRONIZATION-FOR-GITEA # Verify PLAN-AUTOMATED-PER-COMMIT-REPO-ROOT-README-SYNCHRONIZATION-FOR-GITEA
# and PLAN-README-AND-GIT-COMMIT-MESSAGE-VERSION-PARITY-FIX # and PLAN-README-AND-GIT-COMMIT-MESSAGE-VERSION-PARITY-FIX
@@ -1249,29 +1252,32 @@ def test_ipld_quant_and_mcp_server() -> None:
assert js_sig_1["js_ui_sha256"] != js_sig_2["js_ui_sha256"], "Mutating JS DOM control must change js_ui_sha256 fingerprint" assert js_sig_1["js_ui_sha256"] != js_sig_2["js_ui_sha256"], "Mutating JS DOM control must change js_ui_sha256 fingerprint"
assert js_sig_1["has_lens_select_highlight"] is True and js_sig_1["speech_text_count"] == 25 assert js_sig_1["has_lens_select_highlight"] is True and js_sig_1["speech_text_count"] == 25
node_quant_tut_test = subprocess.run( if shutil.which("node"):
[ node_quant_tut_test = subprocess.run(
"node", [
"-e", "node",
f"const QT = require({json.dumps(str(quant_tut_js_p))});" "-e",
"if (QT.episodes.length !== 5) process.exit(1);" f"const QT = require({json.dumps(str(quant_tut_js_p))});"
"let totalScenes = 0;" "if (QT.episodes.length !== 5) process.exit(1);"
"QT.episodes.forEach((ep) => {" "let totalScenes = 0;"
" ep.keyframes.forEach((kf) => {" "QT.episodes.forEach((ep) => {"
" totalScenes++;" " ep.keyframes.forEach((kf) => {"
" if (!Array.isArray(kf.uiTargets) || kf.uiTargets.length === 0) process.exit(2);" " totalScenes++;"
" if (!kf.uiElementLabel || !kf.speechText) process.exit(3);" " if (!Array.isArray(kf.uiTargets) || kf.uiTargets.length === 0) process.exit(2);"
" });" " if (!kf.uiElementLabel || !kf.speechText) process.exit(3);"
"});" " });"
"if (totalScenes !== 25) process.exit(4);" "});"
"const ep04 = QT.episodes[3];" "if (totalScenes !== 25) process.exit(4);"
"if (!ep04.keyframes.every((kf) => kf.uiTargets.includes('lensSelect') && kf.uiTargets.includes('lensProjectionCard'))) process.exit(5);", "const ep04 = QT.episodes[3];"
], "if (!ep04.keyframes.every((kf) => kf.uiTargets.includes('lensSelect') && kf.uiTargets.includes('lensProjectionCard'))) process.exit(5);",
capture_output=True, ],
text=True, capture_output=True,
check=False, text=True,
) check=False,
assert node_quant_tut_test.returncode == 0, f"Node QuantTutorials check failed ({node_quant_tut_test.returncode}): {node_quant_tut_test.stderr}" )
assert node_quant_tut_test.returncode == 0, f"Node QuantTutorials check failed ({node_quant_tut_test.returncode}): {node_quant_tut_test.stderr}"
else:
print("[notice] 'node' executable not found in PATH; skipping Node.js quant tutorials subtest.")
# Verify Plan #57 (Strategies 1A, 2A, 3A): Zero-Git-Audio deploy-time WAV voice compiler (quant_voice.py) & 0 audio files in Git # Verify Plan #57 (Strategies 1A, 2A, 3A): Zero-Git-Audio deploy-time WAV voice compiler (quant_voice.py) & 0 audio files in Git
from hyperstitionstud_io.publishing.quant_voice import build_quant_tour_voice_assets from hyperstitionstud_io.publishing.quant_voice import build_quant_tour_voice_assets