Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.
C aiderastclaude-codecode-analysiscode-intelligencecodexcursorcypherdeveloper-toolsgemini-cligraph-visualizationkilocodeknowledge-graphmcpmcp-servermodel-context-protocolopencodesqlitetree-sitterwindsurf
test(smoke): isolate dry-run command state
SS-429e57c6c259b6
diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.shindex 6feabf10b..2c02f0bc7 100755--- a/scripts/smoke-test.sh+++ b/scripts/smoke-test.sh@@ -12,11 +12,12 @@ set -euo pipefailBINARY="${1:?usage: smoke-test.sh <binary-path>}"REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")/.." && pwd)"TMPDIR=$(mktemp -d)+DRYRUN_HOME=""# On MSYS2/Windows, convert POSIX path to native Windows path for the binaryif command -v cygpath &>/dev/null; thenTMPDIR=$(cygpath -m "$TMPDIR")fi-trap 'rm -rf "$TMPDIR"' EXIT+trap 'rm -rf "$TMPDIR" "${DRYRUN_HOME:-}"' EXITCLI_STDERR=$(mktemp)cli() { "$BINARY" cli "$@" 2>"$CLI_STDERR"; }@@ -679,9 +680,27 @@ rm -f "$MCP_CL_INPUT" "$MCP_CL_OUTPUT" "$MCP_TOOL_INPUT" "$MCP_TOOL_OUTPUT"echo ""echo "=== Phase 6: CLI subcommands ==="+DRYRUN_HOME=$(mktemp -d)+DRYRUN_CACHE="$DRYRUN_HOME/.cache/codebase-memory-mcp"+mkdir -p "$DRYRUN_CACHE" \+ "$DRYRUN_HOME/.local/bin" \+ "$DRYRUN_HOME/.config" \+ "$DRYRUN_HOME/AppData/Roaming" \+ "$DRYRUN_HOME/AppData/Local"++run_dryrun_env() {+ HOME="$DRYRUN_HOME" \+ XDG_CONFIG_HOME="$DRYRUN_HOME/.config" \+ APPDATA="$DRYRUN_HOME/AppData/Roaming" \+ LOCALAPPDATA="$DRYRUN_HOME/AppData/Local" \+ CBM_CACHE_DIR="$DRYRUN_CACHE" \+ PATH="$DRYRUN_HOME/.local/bin:$PATH" \+ "$@"+}+# 6a: install --dry-run -yecho "--- Phase 6a: install --dry-run ---"-INSTALL_OUT=$("$BINARY" install --dry-run -y 2>&1)+INSTALL_OUT=$(run_dryrun_env "$BINARY" install --dry-run -y 2>&1)if ! echo "$INSTALL_OUT" | grep -qi 'install\|skill\|mcp\|agent'; thenecho "FAIL: install --dry-run produced unexpected output"echo "$INSTALL_OUT"@@ -695,7 +714,7 @@ echo "OK: install --dry-run completed"# 6b: uninstall --dry-run -yecho "--- Phase 6b: uninstall --dry-run ---"-UNINSTALL_OUT=$("$BINARY" uninstall --dry-run -y 2>&1)+UNINSTALL_OUT=$(run_dryrun_env "$BINARY" uninstall --dry-run -y 2>&1)if ! echo "$UNINSTALL_OUT" | grep -qi 'uninstall\|remov'; thenecho "FAIL: uninstall --dry-run produced unexpected output"echo "$UNINSTALL_OUT"@@ -705,7 +724,7 @@ echo "OK: uninstall --dry-run completed"# 6c: update --dry-run --standard -yecho "--- Phase 6c: update --dry-run ---"-UPDATE_OUT=$("$BINARY" update --dry-run --standard -y 2>&1)+UPDATE_OUT=$(run_dryrun_env "$BINARY" update --dry-run --standard -y 2>&1)if ! echo "$UPDATE_OUT" | grep -qi 'dry-run'; thenecho "FAIL: update --dry-run did not indicate dry-run mode"echo "$UPDATE_OUT"@@ -730,13 +749,13 @@ echo "OK: update --dry-run --standard completed"# 6d: config set/get/reset round-tripecho "--- Phase 6d: config set/get/reset ---"-"$BINARY" config set auto_index true 2>/dev/null-CONFIG_VAL=$("$BINARY" config get auto_index 2>/dev/null)+run_dryrun_env "$BINARY" config set auto_index true 2>/dev/null+CONFIG_VAL=$(run_dryrun_env "$BINARY" config get auto_index 2>/dev/null)if ! echo "$CONFIG_VAL" | grep -q 'true'; thenecho "FAIL: config get auto_index returned '$CONFIG_VAL', expected 'true'"exit 1fi-"$BINARY" config reset auto_index 2>/dev/null+run_dryrun_env "$BINARY" config reset auto_index 2>/dev/nullecho "OK: config set/get/reset round-trip"# 6e: Simulated binary replacement (update flow without network)