-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsmoke_test_cli.sh
More file actions
executable file
·53 lines (45 loc) · 1.74 KB
/
smoke_test_cli.sh
File metadata and controls
executable file
·53 lines (45 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
set -euo pipefail
echo "=== FellowQuant RAG CLI Smoke Test ==="
# Find the most recent wheel
WHEEL=$(ls dist/*.whl 2>/dev/null | sort -V | tail -1)
if [ -z "$WHEEL" ]; then
echo "ERROR: No wheel found in dist/. Run 'hatch build' first." >&2
exit 1
fi
echo "Testing wheel: $WHEEL"
# Create a temporary virtualenv
TMPVENV=$(mktemp -d)
trap "rm -rf $TMPVENV" EXIT
python -m venv "$TMPVENV"
source "$TMPVENV/bin/activate"
# Install the wheel (no extras — just the package)
pip install --quiet "$WHEEL"
# Verify entry point exists
if ! command -v rag-server &>/dev/null; then
echo "ERROR: rag-server entry point not found on PATH after install." >&2
exit 1
fi
echo " [OK] rag-server entry point found at: $(which rag-server)"
# Verify it exits with usage message (no args = usage + exit 1 is acceptable)
# We capture the output and check it mentions expected subcommands
OUTPUT=$(rag-server 2>&1 || true)
for CMD in start mcp start-qdrant setup; do
if echo "$OUTPUT" | grep -q "$CMD"; then
echo " [OK] subcommand '$CMD' mentioned in usage"
else
echo " [WARN] subcommand '$CMD' not found in usage output"
fi
done
# Verify importlib.resources can read assets (no CUDA/GPU needed — pure stdlib)
python -c "
from importlib.resources import files
dc = files('rag_server.assets').joinpath('docker-compose.yml').read_text()
assert 'qdrant/qdrant' in dc, 'docker-compose.yml asset missing qdrant service'
assert 'build:' not in dc, 'embedded docker-compose.yml must not have rag-server build service'
lly = files('rag_server.assets').joinpath('llm.yaml.example').read_text()
assert len(lly) > 10, 'llm.yaml.example is empty'
print(' [OK] Embedded assets accessible via importlib.resources')
"
echo ""
echo "=== Smoke test PASSED ==="