mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
- 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
42 lines
884 B
Bash
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"
|
|
|