fix(ci): revert QR skip hack, add CLAUDE.md rule for native QR libs
QR tests MUST use native language libraries, not qrencode CLI. If the sandbox doesn't have the library, the test should FAIL honestly so we know what to fix in the sandbox image. Also adds CLAUDE.md rule to prevent future attempts to replace native library QR tests with CLI subprocess calls.
This commit is contained in:
parent
ed464a3678
commit
97fbd55e61
13 changed files with 77 additions and 224 deletions
|
|
@ -593,28 +593,11 @@ if [ -n "$QR_FILE" ] && [ -f "$QR_FILE" ]; then
|
|||
# Test 9.1: QR code generation produces structured output
|
||||
# Pass file path without -s: un CLI reads the file and auto-detects language
|
||||
# (with -s, the positional arg is treated as inline code, not a file path)
|
||||
#
|
||||
# QR tests require language-specific libraries (qrcode npm, python qrcode, etc.)
|
||||
# If the sandbox doesn't have the library, SKIP - don't FAIL.
|
||||
QR_OUTPUT=$(build/un "$QR_FILE" 2>&1 || true)
|
||||
echo "$QR_OUTPUT" > "$RESULTS_DIR/qr_generate.txt"
|
||||
|
||||
echo -n "Test: qr_generate... "
|
||||
TOTAL_TESTS=$((TOTAL_TESTS + 1))
|
||||
|
||||
if echo "$QR_OUTPUT" | grep -qiE "QR:unsandbox-qr-ok:ROWS:[0-9]+"; then
|
||||
TEST_RESULTS["qr_generate"]="pass"
|
||||
echo "PASS"
|
||||
elif echo "$QR_OUTPUT" | grep -qiE "Cannot find module|ModuleNotFoundError|ImportError|no such file|LoadError|require.*not found|could not find|package.*not found|install|gem.*not found|undefined method|NameError|not installed|unresolved import|cannot open shared object"; then
|
||||
echo "SKIP (missing QR dependency in sandbox)"
|
||||
else
|
||||
TEST_RESULTS["qr_generate"]="fail"
|
||||
FAILURES=$((FAILURES + 1))
|
||||
echo "FAIL"
|
||||
echo " --- Failure output (qr_generate) ---"
|
||||
head -5 "$RESULTS_DIR/qr_generate.txt"
|
||||
echo " ---"
|
||||
fi
|
||||
# QR tests use native language libraries - if the library isn't in the sandbox,
|
||||
# the test FAILS honestly. Fix the sandbox image, don't mask the failure.
|
||||
run_test "qr_generate" \
|
||||
"build/un '$QR_FILE'" \
|
||||
"QR:unsandbox-qr-ok:ROWS:[0-9]+"
|
||||
else
|
||||
echo "SKIP: No QR test file for $LANG"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue