Files
LangBot/scripts/test-quick.sh
huanghuoguoguo 25bf3ea0b3 feat(test): add developer test-quick command
Add scripts/test-quick.sh and Makefile with:
- test-quick: runs ruff check + unit tests + smoke tests
- No real provider keys or platform accounts required
- Suitable for local branch self-test

Update tests/README.md:
- Document test-quick command
- Document test factories package
- Add smoke tests and factories directory structure

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 10:12:48 +08:00

37 lines
895 B
Bash
Executable File

#!/bin/bash
# Quick developer self-test command
# Runs linting, unit tests, and smoke tests without requiring real provider keys
# Suitable for local branch validation
set -e
echo "=== LangBot Quick Self-Test ==="
echo ""
# 1. Ruff check
echo "[1/3] Running ruff check..."
if command -v ruff &> /dev/null; then
ruff check src/langbot/ tests/ --quiet || {
echo "⚠ Ruff check found issues. Run 'ruff check --fix' to auto-fix."
}
else
echo "⚠ ruff not installed, skipping lint check"
fi
echo ""
# 2. Unit tests
echo "[2/3] Running unit tests..."
uv run pytest tests/unit_tests/ -q --tb=short 2>&1 | tail -5
echo ""
# 3. Smoke tests (if exists)
echo "[3/3] Running smoke tests..."
if [ -d "tests/smoke" ]; then
uv run pytest tests/smoke/ -q --tb=short 2>&1 | tail -5
else
echo "No smoke tests found, skipping"
fi
echo ""
echo "=== Quick Self-Test Complete ==="