Files
semantica/.github/scripts/run-tests.sh
T
KaifAhmad1 1271957737 security: Add explicit permissions and security scanning workflow
- Add explicit permissions to all workflows (format, release, ci, test, label-issues, mark-answered)
- Fix format.yml to have write permissions for PR creation
- Add security.yml workflow for automated vulnerability scanning
- Improve security posture with minimal permissions principle
2025-11-24 17:20:10 +05:30

42 lines
884 B
Bash

#!/bin/bash
# Test runner script
# Runs tests with coverage reporting
set -e
echo "🧪 Running tests..."
# Activate virtual environment if it exists
if [ -d "venv" ]; then
source venv/bin/activate
fi
# Check if tests directory exists
if [ ! -d "tests" ]; then
echo "⚠️ No tests directory found"
echo " Create tests/ directory and add test files"
exit 0
fi
# Check if test files exist
if [ -z "$(find tests -name 'test_*.py' -o -name '*_test.py' 2>/dev/null)" ]; then
echo "⚠️ No test files found"
echo " Add test files to tests/ directory"
exit 0
fi
# Run tests with coverage
echo "📊 Running pytest with coverage..."
pytest \
--cov=semantica \
--cov-report=html \
--cov-report=term-missing \
--cov-report=xml \
-v \
tests/
echo ""
echo "✅ Tests complete!"
echo "📊 Coverage report: htmlcov/index.html"