Spaces:
Running
Running
| # ============================================================================= | |
| # run_tests.sh β Full test suite runner for CodeSentry Backend | |
| # ============================================================================= | |
| set -euo pipefail | |
| echo "============================================================" | |
| echo " CodeSentry Backend β Test Suite" | |
| echo "============================================================" | |
| # Move to project root (one level up from scripts/) | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| PROJECT_ROOT="$(dirname "$SCRIPT_DIR")" | |
| cd "$PROJECT_ROOT" | |
| # ββ Install test dependencies ββββββββββββββββββββββββββββββββββ | |
| echo "[Setup] Installing test dependencies..." | |
| pip install pytest pytest-asyncio httpx -q | |
| # ββ Set environment so tests run in no-LLM mode βββββββββββββββ | |
| export USE_LLM=false | |
| export VLLM_BASE_URL=http://localhost:8080 | |
| export MODEL_NAME=Qwen/Qwen2.5-Coder-32B-Instruct | |
| echo "" | |
| echo "[Config]" | |
| echo " USE_LLM = $USE_LLM" | |
| echo " VLLM_BASE_URL = $VLLM_BASE_URL" | |
| echo "" | |
| # ββ Run test suite βββββββββββββββββββββββββββββββββββββββββββββ | |
| echo "[Running] pytest tests/ ..." | |
| echo "" | |
| pytest tests/ \ | |
| -v \ | |
| --tb=short \ | |
| --asyncio-mode=auto \ | |
| --color=yes \ | |
| -x # Stop on first failure for hackathon speed | |
| EXIT_CODE=$? | |
| echo "" | |
| if [ "$EXIT_CODE" -eq 0 ]; then | |
| echo "============================================================" | |
| echo " β All tests PASSED" | |
| echo "============================================================" | |
| else | |
| echo "============================================================" | |
| echo " β Some tests FAILED (exit code: $EXIT_CODE)" | |
| echo "============================================================" | |
| fi | |
| exit "$EXIT_CODE" | |