mirror of
https://github.com/0xrsydn/nix-hermes-agent.git
synced 2026-08-07 00:53:52 +00:00
test: add hermes-agent import check
Verifies hermes-agent starts without ModuleNotFoundError. Exits cleanly with 'Failed to initialize OpenAI client' (expected — no API key in test).
This commit is contained in:
parent
1d95780fff
commit
6024741356
1 changed files with 22 additions and 0 deletions
22
checks.nix
22
checks.nix
|
|
@ -61,6 +61,28 @@
|
|||
echo "ok" > $out/result
|
||||
'';
|
||||
|
||||
# Verify hermes-agent doesn't crash on import (exit 124 = timeout, not import error)
|
||||
hermes-agent-import = pkgs.runCommand "hermes-agent-import" { } ''
|
||||
set -e
|
||||
export HOME=$(mktemp -d)
|
||||
|
||||
echo "=== Testing hermes-agent starts without import errors ==="
|
||||
# hermes-agent is interactive (fire CLI), so it will hang waiting for input.
|
||||
# Exit 124 (timeout) = OK. Any other exit = import/crash error.
|
||||
timeout 3 ${hermes-agent}/bin/hermes-agent 2>&1 || CODE=$?
|
||||
if [ "''${CODE:-0}" = "124" ]; then
|
||||
echo "PASS: hermes-agent starts (timed out waiting for input, no import errors)"
|
||||
elif [ "''${CODE:-0}" = "0" ]; then
|
||||
echo "PASS: hermes-agent exited cleanly"
|
||||
else
|
||||
echo "FAIL: hermes-agent crashed with exit code $CODE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p $out
|
||||
echo "ok" > $out/result
|
||||
'';
|
||||
|
||||
# Verify doctor runs without crashing
|
||||
doctor = pkgs.runCommand "hermes-doctor" { } ''
|
||||
set -e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue