fix: CLI test, TUI integration harness — all non-blockers resolved
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s
- gateway-cli: add load-time sanity check, fix FiveAM prefix for jailed-package compatibility - TUI integration: switch all tests from file-grep to tmux capture-pane (agent-responds, cascade-failure, eval-command, connection-drop). Fixes file-buffering false negatives. Increase eval sleep to 3s. - Cherry-pick: system-integration-tests.org org source updated
This commit is contained in:
@@ -350,30 +350,26 @@ done
|
||||
|
||||
test_agent_responds() {
|
||||
# Full round-trip: TUI → daemon → pipeline → TUI.
|
||||
# Polls for ⬇ marker (any 3+ letter agent response).
|
||||
# Uses tmux capture-pane to read the rendered screen.
|
||||
local before_ts
|
||||
before_ts=$(date +%s)
|
||||
|
||||
tmux send-keys -t tui-test "hello" Enter
|
||||
|
||||
while true; do
|
||||
if grep -q '⬇.*[a-zA-Z]\{3,\}' "$TUI_LOG"; then
|
||||
if tmux capture-pane -t tui-test -p -S -50 2>/dev/null | grep -q '⬇.*[a-zA-Z]\{3,\}'; then
|
||||
return 0
|
||||
fi
|
||||
local now_ts
|
||||
now_ts=$(date +%s)
|
||||
if (( now_ts - before_ts > 60 )); then
|
||||
echo "TIMEOUT: no agent response in log after 60s" >&2
|
||||
echo "TIMEOUT: no agent response after 60s" >&2
|
||||
return 1
|
||||
fi
|
||||
sleep 1
|
||||
sleep 2
|
||||
done
|
||||
}
|
||||
|
||||
test_agent_not_cascade_failure() {
|
||||
# Check if the ⬇ response is a cascade failure meaning no LLM backend is configured.
|
||||
# This is a WARNING, not a failure — the daemon is alive but needs an API key.
|
||||
if grep '⬇' "$TUI_LOG" | grep -qi 'cascade.*fail\|exhausted\|neural cascade'; then
|
||||
if tmux capture-pane -t tui-test -p -S -50 2>/dev/null | grep '⬇' | grep -qi 'cascade.*fail\|exhausted\|neural cascade'; then
|
||||
echo "NOTE: LLM cascade failure — no API key configured (warning only)" >&2
|
||||
WARN=$((WARN + 1))
|
||||
fi
|
||||
@@ -382,8 +378,8 @@ test_agent_not_cascade_failure() {
|
||||
|
||||
test_eval_command() {
|
||||
tmux send-keys -t tui-test "/eval (+ 1 2)" Enter
|
||||
sleep 2
|
||||
grep -q '=> 3' "$TUI_LOG"
|
||||
sleep 3
|
||||
tmux capture-pane -t tui-test -p -S -10 2>/dev/null | grep -q '=> 3'
|
||||
}
|
||||
|
||||
test_status_bar() {
|
||||
@@ -391,14 +387,8 @@ test_status_bar() {
|
||||
}
|
||||
|
||||
test_connection_drop() {
|
||||
# Drop the daemon's connection to the TUI (the TUI notices and logs an error).
|
||||
# We don't kill the daemon itself — just close its TCP listener temporarily.
|
||||
# If the daemon and TUI share the same host, restarting the TUI's session
|
||||
# forces a reconnect. This test is best-effort; in pure headless mode,
|
||||
# the connection may already be lost from the TUI startup delay.
|
||||
sleep 1
|
||||
grep -qi 'connection.*lost\|ERROR.*Connection\|error.*connect' "$TUI_LOG" || true
|
||||
# Not a hard failure — connection monitoring depends on TUI rendering speed
|
||||
tmux capture-pane -t tui-test -p -S -10 2>/dev/null | grep -qi 'connection.*lost\|ERROR.*Connection\|error.*connect' || true
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user