-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·37 lines (28 loc) · 832 Bytes
/
run_tests.sh
File metadata and controls
executable file
·37 lines (28 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Test-Runner-Script für Python IPAM
set -e
echo "=== Python IPAM Test Suite ==="
echo ""
# Virtuelle Umgebung aktivieren falls vorhanden
if [ -d "venv" ]; then
echo "Aktiviere virtuelle Umgebung..."
source venv/bin/activate
fi
# Dependencies prüfen
echo "Prüfe Dependencies..."
pip install -r requirements.txt > /dev/null 2>&1
# Linting (optional, falls installiert)
if command -v flake8 &> /dev/null; then
echo "Führe Code-Linting aus..."
flake8 app.py tests/ --max-line-length=100 --ignore=E501,W503
fi
# Tests ausführen
echo "Führe Unit-Tests aus..."
pytest -v
# Coverage-Report
echo ""
echo "Erstelle Coverage-Report..."
pytest --cov=app --cov-report=term-missing --cov-report=html
echo ""
echo "=== Tests abgeschlossen ==="
echo "Coverage-Report verfügbar unter: htmlcov/index.html"