Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions core/tests/test_install_convergence.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ def _write_executable(path: Path, content: str) -> None:
path.chmod(0o755)


def _install_fixture(tmp_path: Path, scenario: str) -> tuple[Path, dict[str, str]]:
def _install_fixture(
tmp_path: Path,
scenario: str,
chat_app: str | None = None,
) -> tuple[Path, dict[str, str]]:
root = tmp_path / "dex-install"
root.mkdir()
shutil.copy2(REPO_ROOT / "install.sh", root / "install.sh")
Expand Down Expand Up @@ -88,6 +92,8 @@ def _install_fixture(tmp_path: Path, scenario: str) -> tuple[Path, dict[str, str
for command in ("npm", "npx"):
_write_executable(shim_dir / command, "#!/bin/sh\nexit 0\n")
_write_executable(shim_dir / "xcode-select", "#!/bin/sh\nexit 0\n")
if chat_app is not None:
_write_executable(shim_dir / chat_app, "#!/bin/sh\nexit 0\n")

environment = os.environ.copy()
environment.update(
Expand All @@ -105,8 +111,9 @@ def _run_install(
tmp_path: Path,
scenario: str,
*arguments: str,
chat_app: str | None = None,
) -> tuple[subprocess.CompletedProcess[str], list[str]]:
root, environment = _install_fixture(tmp_path, scenario)
root, environment = _install_fixture(tmp_path, scenario, chat_app)
result = subprocess.run(
["/bin/bash", "install.sh", *arguments],
cwd=root,
Expand Down Expand Up @@ -174,3 +181,24 @@ def test_migration_failure_stops_install_with_plain_english_recovery(tmp_path: P
assert "could not finish the brain/vault split" in result.stdout
assert "migration-report-v2.md" in result.stdout
assert "Dex installation complete" not in result.stdout


def test_install_points_claude_code_users_at_the_install_folder(tmp_path: Path) -> None:
result, _ = _run_install(tmp_path, "zip", chat_app="claude")

assert result.returncode == 0, result.stdout + result.stderr
assert "Open Claude Code in this folder" in result.stdout
assert "the folder you just installed into" in result.stdout
assert "In Claude Code chat, type: /setup" in result.stdout
# Detection must name one app only, never leak the other.
assert "In Cursor chat, type: /setup" not in result.stdout


def test_install_points_cursor_users_at_the_install_folder(tmp_path: Path) -> None:
result, _ = _run_install(tmp_path, "zip", chat_app="cursor")

assert result.returncode == 0, result.stdout + result.stderr
assert "Open Cursor in this folder" in result.stdout
assert "the folder you just installed into" in result.stdout
assert "In Cursor chat, type: /setup" in result.stdout
assert "In Claude Code chat, type: /setup" not in result.stdout
8 changes: 5 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ if [[ "$WORK_MCP_STATUS" == *"Needs"* ]]; then
fi
echo ""
echo "Next steps:"
echo " 1. In $DEX_CHAT_APP chat, type: /setup"
echo " 2. Answer the setup questions (~5 minutes)"
echo " 3. Start using Dex!"
echo " 1. Open $DEX_CHAT_APP in this folder"
echo " (the folder you just installed into — not somewhere else)"
echo " 2. In $DEX_CHAT_APP chat, type: /setup"
echo " 3. Answer the setup questions (~5 minutes)"
echo " 4. Start using Dex!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
Loading