-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_tests.py
More file actions
executable file
·51 lines (41 loc) · 1.33 KB
/
run_tests.py
File metadata and controls
executable file
·51 lines (41 loc) · 1.33 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python3
"""Test runner script for claude-setup CLI application."""
import subprocess
import sys
from pathlib import Path
def run_tests():
"""Run the test suite with coverage reporting."""
print("Running claude-setup test suite...")
print("=" * 60)
# Change to project directory
project_dir = Path(__file__).parent
try:
# Run tests with coverage
cmd = [
"pipenv",
"run",
"pytest",
"tests/",
"-v",
"--cov=src/claude_setup",
"--cov-report=term-missing",
"--cov-report=html:htmlcov",
"--cov-fail-under=95",
]
result = subprocess.run(cmd, cwd=project_dir, check=False)
if result.returncode == 0:
print("\n" + "=" * 60)
print("✅ All tests passed! Coverage target met.")
print("📊 HTML coverage report generated in htmlcov/")
else:
print("\n" + "=" * 60)
print("❌ Some tests failed or coverage target not met.")
sys.exit(1)
except FileNotFoundError:
print("❌ Error: pipenv not found. Please install pipenv first.")
sys.exit(1)
except Exception as e:
print(f"❌ Error running tests: {e}")
sys.exit(1)
if __name__ == "__main__":
run_tests()