Skip to content

Commit 6300feb

Browse files
committed
Fix smoke tests: variant detection, Windows deps, UI reachability
- Phase 14: detect UI vs standard variant from HTTP server contents instead of hardcoding --standard (fixes UI smoke failure) - Windows smoke: install zip + coreutils (sha256sum) in MSYS2 (fixes exit code 127) - Phase 15: UI HTTP server reachability test — verifies root returns 200 and /rpc accepts POST (skips gracefully for non-UI builds) - Fix switch fallthrough in release.yml (same MSYS2 deps)
1 parent 65a38be commit 6300feb

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

.github/workflows/dry-run.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ jobs:
449449
install: >-
450450
mingw-w64-clang-x86_64-python3
451451
unzip
452+
zip
453+
coreutils
452454
453455
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
454456
with:

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ jobs:
446446
install: >-
447447
mingw-w64-clang-x86_64-python3
448448
unzip
449+
zip
450+
coreutils
449451
450452
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
451453
with:

scripts/smoke-test.sh

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,9 +1010,13 @@ if [ -n "${SMOKE_DOWNLOAD_URL:-}" ]; then
10101010
# Pre-install agent config with a WRONG binary path (simulates stale config)
10111011
echo '{"mcpServers":{"codebase-memory-mcp":{"command":"/old/stale/path"}}}' > "$UPDATE_HOME/.claude.json"
10121012

1013-
# 14a: Run actual update command
1013+
# 14a: Run actual update command (detect variant from available archive)
1014+
UPDATE_VARIANT="--standard"
1015+
if curl -sf "$SMOKE_DOWNLOAD_URL/" 2>/dev/null | grep -q "ui-"; then
1016+
UPDATE_VARIANT="--ui"
1017+
fi
10141018
HOME="$UPDATE_HOME" CBM_DOWNLOAD_URL="$SMOKE_DOWNLOAD_URL" \
1015-
"$BINARY" update --standard -y 2>&1 || true
1019+
"$BINARY" update $UPDATE_VARIANT -y 2>&1 || true
10161020

10171021
# 14b: Verify new binary exists and runs
10181022
if [ ! -f "$UPDATE_HOME/.local/bin/codebase-memory-mcp" ]; then
@@ -1329,5 +1333,49 @@ else
13291333
echo "=== Phase 12-13: SKIPPED (SMOKE_DOWNLOAD_URL not set) ==="
13301334
fi
13311335

1336+
# ── Phase 15: UI HTTP server reachability ──
1337+
# Only runs if the binary was built with embedded UI assets.
1338+
echo ""
1339+
echo "=== Phase 15: UI HTTP server ==="
1340+
1341+
UI_PORT=19876
1342+
UI_INPUT=$(mktemp)
1343+
"$BINARY" --port "$UI_PORT" < "$UI_INPUT" > /dev/null 2>&1 &
1344+
UI_PID=$!
1345+
sleep 1
1346+
1347+
if kill -0 "$UI_PID" 2>/dev/null; then
1348+
# 15a: HTTP root returns 200
1349+
UI_STATUS=$(curl -sf -o /dev/null -w "%{http_code}" "http://127.0.0.1:$UI_PORT/" 2>/dev/null || echo "000")
1350+
if [ "$UI_STATUS" = "200" ]; then
1351+
echo "OK 15a: UI root returns 200"
1352+
elif [ "$UI_STATUS" = "000" ]; then
1353+
echo "SKIP 15a: UI not reachable (binary may not have embedded assets)"
1354+
else
1355+
echo "FAIL 15a: UI root returned $UI_STATUS"
1356+
kill "$UI_PID" 2>/dev/null || true
1357+
exit 1
1358+
fi
1359+
1360+
# 15b: /rpc endpoint accepts POST
1361+
RPC_STATUS=$(curl -sf -o /dev/null -w "%{http_code}" -X POST \
1362+
-H "Content-Type: application/json" \
1363+
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' \
1364+
"http://127.0.0.1:$UI_PORT/rpc" 2>/dev/null || echo "000")
1365+
if [ "$RPC_STATUS" = "200" ]; then
1366+
echo "OK 15b: UI /rpc endpoint returns 200"
1367+
elif [ "$RPC_STATUS" = "000" ]; then
1368+
echo "SKIP 15b: /rpc not reachable"
1369+
else
1370+
echo "FAIL 15b: /rpc returned $RPC_STATUS"
1371+
fi
1372+
1373+
kill "$UI_PID" 2>/dev/null || true
1374+
wait "$UI_PID" 2>/dev/null || true
1375+
else
1376+
echo "SKIP Phase 15: binary exited immediately (no UI assets embedded)"
1377+
fi
1378+
rm -f "$UI_INPUT"
1379+
13321380
echo ""
13331381
echo "=== smoke-test: ALL PASSED ==="

0 commit comments

Comments
 (0)