Files
hx/tests/e2e.sh
T
hermes 21d4d2bb3d
ci / check (push) Canceled after 0s
M1: agent loop, tools, sessions, context, skills
- hx-core: Tool trait + registry (schema validation, parallel calls), event bus with Block/Mutate/Inject hooks,
  agent loop (abort, max turns, AgentEnd inject), JSONL session tree (fork, resume, torn-line tolerant),
  AGENTS.md/CLAUDE.md hierarchy, skills index (bodies on demand)
- hx-tools: read (ranges, binary, images, caps), write/edit (exact match, ambiguity, CRLF, diff, read-guard), bash (merged output, timeout kills process group, tail truncation to temp file)
- hx-cli: -p runs full agent loop, --session / --continue, Ctrl-C abort, HX_BASE_URL override
- tests/e2e.sh: scripted fake Anthropic server drives write -> bash -> answer

Closes #6, closes #7, closes #8, closes #9, closes #10, closes #11, closes #12, closes #13, closes #14
2026-09-30 09:36:16 +00:00

22 lines
959 B
Bash
Executable File

#!/bin/sh
# End-to-end: hx -p against a scripted fake Anthropic API. No network, no real credentials.
set -eu
root=$(cd "$(dirname "$0")/.." && pwd)
tmp=$(mktemp -d)
trap 'kill $srv 2>/dev/null; rm -rf "$tmp"' EXIT
port=$((20000 + $$ % 20000))
python3 "$root/tests/fake_anthropic.py" $port & srv=$!
mkdir -p "$tmp/home/.hx" "$tmp/repo"
echo '{"claude":{"access":"fake-token","refresh":"r","expires":99999999999999}}' > "$tmp/home/.hx/auth.json"
sleep 0.5
cd "$tmp/repo"
HOME="$tmp/home" HX_BASE_URL="http://127.0.0.1:$port" "$root/target/debug/hx" -p "make hello.txt" > "$tmp/out" 2> "$tmp/err"
grep -q "Done: file says hi from hx." "$tmp/out"
[ "$(cat hello.txt)" = "hi from hx" ]
log=$(curl -s "http://127.0.0.1:$port/")
echo "$log" | grep -q '"auth": "Bearer fake-token"'
echo "$log" | grep -q 'oauth-2025-04-20'
echo "$log" | grep -q 'hi from hx' # bash tool result sent back to the model
ls "$tmp/home/.hx/sessions/"*/*.jsonl > /dev/null
echo "e2e ok"