From 4ce03051a23b79ecd5f826ffa5507cbedcf53da2 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Sat, 6 Jun 2026 16:58:53 +0200 Subject: [PATCH] Check stderr for the unsupported-function smoke assertion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cypher unsupported-function check captured stdout, but the CLI prints the parse error to stderr (which cli() redirects into $CLI_STDERR) and exits non-zero, leaving stdout empty — so the assertion always failed once the run reached the smoke stage. Verify the exit status and the stderr channel where the binary actually reports the loud failure. Confirmed locally: full smoke-test.sh passes. --- scripts/smoke-test.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index d941e75e9..a4d080b39 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -306,8 +306,13 @@ NX_OK=$(echo "$CYPHER_NX" | python3 -c "import json,sys; d=json.loads(sys.stdin. CASEV=$(cyp_first_cell 'MATCH (f:Function) RETURN CASE WHEN f.name =~ ".+" THEN "named" ELSE "anon" END AS c LIMIT 1') [ "$CASEV" = "named" ] && echo "OK: query_graph CASE expression = $CASEV" || { echo "FAIL: CASE returned '$CASEV'"; exit 1; } -# unsupported function must FAIL LOUDLY (not silently return empty) -ERROUT=$(cli query_graph "{\"project\":\"$PROJECT\",\"query\":\"MATCH (f:Function) RETURN nosuchfn(f.name)\"}" 2>&1 || true) +# unsupported function must FAIL LOUDLY (not silently return empty). The CLI +# prints the parse error to stderr (captured by cli() into $CLI_STDERR) and exits +# non-zero, leaving stdout empty — so verify the loud failure on that channel. +if cli query_graph "{\"project\":\"$PROJECT\",\"query\":\"MATCH (f:Function) RETURN nosuchfn(f.name)\"}" >/dev/null; then + echo "FAIL: unsupported function did not error (exit 0)"; exit 1 +fi +ERROUT=$(cat "$CLI_STDERR" 2>/dev/null) case "$ERROUT" in *unsupported*) echo "OK: unsupported function errors loudly" ;; *) echo "FAIL: unsupported function did not error: $ERROUT" | head -c 300; exit 1 ;;