Skip to content

Commit c2c00eb

Browse files
pncclaude
andcommitted
Add e2e tests for uv and Claude Code installation
Verify that both tools are installed and on PATH after cloud-init provisioning. Also update CLAUDE.md to note that tests run inside this VM. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 67bef94 commit c2c00eb

2 files changed

Lines changed: 37 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
## Development workflow
66

7-
Before running the e2e tests, ensure the test prerequisites from
8-
HACKING.md are installed.
7+
The e2e tests run inside this VM. If `uv` is not yet installed, install
8+
it first (see Tooling policy below). Ensure the test prerequisites from
9+
HACKING.md are also installed.
910

1011
Always run the test suite before committing:
1112

tests/test_e2e.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,40 @@ def test_docker_hello_world(running_vm):
332332
)
333333

334334

335+
def test_uv_installed(running_vm):
336+
"""uv should be installed and functional after cloud-init provisioning."""
337+
_progress("Checking uv installation…")
338+
r = _vm_ssh("bash -lc 'uv --version'", timeout=30)
339+
assert r.returncode == 0, (
340+
f"uv not installed or not on PATH (rc={r.returncode}):\n"
341+
f"stdout: {r.stdout[:500]}\nstderr: {r.stderr[:500]}"
342+
)
343+
assert "uv" in r.stdout, f"Unexpected uv --version output: {r.stdout}"
344+
345+
346+
def test_claude_code_installed(running_vm):
347+
"""Claude Code CLI should be installed and functional after cloud-init provisioning."""
348+
_progress("Checking Claude Code installation…")
349+
r = _vm_ssh("bash -lc 'claude --version'", timeout=30)
350+
if r.returncode != 0:
351+
diag = _vm_ssh(
352+
"bash -lc 'ls -la ~/.local/bin/claude 2>&1; "
353+
"ls ~/.local/share/claude/versions/ 2>&1; "
354+
"echo PATH=$PATH'",
355+
timeout=10,
356+
)
357+
assert False, (
358+
f"claude not installed or not on PATH (rc={r.returncode}):\n"
359+
f"stderr: {r.stderr[:500]}\n"
360+
f"diagnostics:\n{diag.stdout[:1000]}"
361+
)
362+
output = (r.stdout + r.stderr).lower()
363+
assert "claude" in output, (
364+
f"Unexpected claude --version output:\n"
365+
f"stdout: {r.stdout!r}\nstderr: {r.stderr!r}"
366+
)
367+
368+
335369
def test_blocked_domain(running_vm):
336370
"""Requests to domains not in filter.py's allowlist should be blocked with 403."""
337371
result = _vm_ssh(

0 commit comments

Comments
 (0)