pi-allium-port/smoke/test-propagate.sh

40 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -uo pipefail
# Smoke test: /skill:propagate loads and the model responds with test generation methodology
# Expects: the response discusses test obligations, assertions, or test categories
cd "$(dirname "$0")/.."
MODEL="Qwen3.6-35B-A3B-MXFP4_MOE.gguf"
TIMEOUT=180
echo "=== propagate: invoking pi ==="
output=$(timeout "$TIMEOUT" pi -p --no-session --model "$MODEL" \
"/skill:propagate Given an Allium entity Order with status: pending | confirmed | shipped and a rule ConfirmOrder that transitions pending to confirmed, what test obligations would you derive? Keep it under 100 words." 2>&1)
rc=$?
if [ $rc -ne 0 ]; then
echo " FAIL: pi exited with code $rc"
echo "$output" | tail -20
exit 1
fi
if [ -z "$output" ]; then
echo " FAIL: empty response"
exit 1
fi
echo "$output"
echo ""
# Check the response is relevant to test generation
if echo "$output" | grep -iqE 'test|assert|obligation|transition|valid|invalid|state|verif|propert'; then
echo " PASS: response contains propagation-relevant content"
exit 0
else
echo " FAIL: response does not appear to follow propagation methodology"
exit 1
fi