#!/bin/bash # Simple test runner script for PunimTag backend tests set -e # Colors for output GREEN='\033[0;32m' RED='\033[0;31m' YELLOW='\033[1;33m' NC='\033[0m' # No Color echo -e "${YELLOW}๐Ÿงช Running PunimTag Backend Tests${NC}" echo "" # Set environment variables export PYTHONPATH=$(pwd) export SKIP_DEEPFACE_IN_TESTS=1 # Check if venv exists if [ ! -d "venv" ]; then echo -e "${RED}โŒ Virtual environment not found. Please create it first:${NC}" echo " python3 -m venv venv" echo " source venv/bin/activate" echo " pip install -r requirements.txt" exit 1 fi # Check if pytest is installed if ! ./venv/bin/python3 -m pytest --version > /dev/null 2>&1; then echo -e "${YELLOW}โš ๏ธ pytest not found. Installing dependencies...${NC}" ./venv/bin/pip install -r requirements.txt fi echo -e "${GREEN}โœ… Environment ready${NC}" echo "" echo "Running tests..." echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" echo "" # Run tests with clear output ./venv/bin/python3 -m pytest tests/ -v --tb=short echo "" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" echo -e "${GREEN}โœ… Tests completed${NC}"