ci: handle null response when LU list is empty after deletion

Go's json.Encode outputs null for nil slices. Handle both null and
empty array in the LU removal verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lei Xue
2026-03-14 20:52:58 +08:00
parent d8210c935a
commit 7a2af97a26

View File

@@ -224,7 +224,7 @@ jobs:
echo "--- verify lu removed ---"
curl -sf "$API/lu/list?target=$NEW_TARGET" | tee /tmp/list_lu3.out
echo ""
python3 -c "import json,sys; data=json.load(sys.stdin); assert len(data)==0, f'expected 0 LUs, got {len(data)}'" < /tmp/list_lu3.out
python3 -c "import json,sys; data=json.load(sys.stdin); assert data is None or len(data)==0, f'expected 0 LUs, got {data}'" < /tmp/list_lu3.out
echo "PASS: LU no longer in list"
# 10. Remove the target