This repository was archived by the owner on May 12, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_tests.py
More file actions
executable file
·94 lines (75 loc) · 2.52 KB
/
Copy pathrun_tests.py
File metadata and controls
executable file
·94 lines (75 loc) · 2.52 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env python3
"""
Quick test runner to verify testing setup
Run with: python run_tests.py
"""
import subprocess
import sys
def run_command(cmd, description):
"""Run a command and report results"""
print(f"\n{'='*60}")
print(f"Running: {description}")
print(f"Command: {cmd}")
print("=" * 60)
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
if result.returncode == 0:
print(f"✅ {description} - PASSED")
if result.stdout:
print(result.stdout)
else:
print(f"❌ {description} - FAILED")
if result.stderr:
print("STDERR:", result.stderr)
if result.stdout:
print("STDOUT:", result.stdout)
return result.returncode == 0
def main():
"""Run basic tests to verify setup"""
print("🧪 HireScope Testing Setup Verification")
print("=" * 60)
# Check if we're in virtual environment
if not hasattr(sys, "real_prefix") and not (
hasattr(sys, "base_prefix") and sys.base_prefix != sys.prefix
):
print("⚠️ Warning: Not in a virtual environment!")
print(" Run: source venv/bin/activate")
# Check if test dependencies are installed
try:
import pytest # noqa: F401
import pytest_cov # noqa: F401
print("✅ Test dependencies installed")
except ImportError as e:
print(f"❌ Missing test dependencies: {e}")
print(" Run: pip install -r requirements-dev.txt")
return 1
# Run tests
all_passed = True
# 1. Unit tests
if not run_command(
"pytest tests/unit/test_document_processor.py -v",
"Unit Tests for DocumentProcessor",
):
all_passed = False
# 2. Linting
if not run_command("ruff check hirescope/document_processor.py", "Ruff Linting"):
all_passed = False
# 3. Type checking
if not run_command(
"mypy hirescope/document_processor.py --ignore-missing-imports",
"MyPy Type Checking",
):
all_passed = False
# Summary
print("\n" + "=" * 60)
if all_passed:
print("✅ All checks passed! Testing infrastructure is working correctly.")
print("\nNext steps:")
print("1. Run full test suite: make test-all")
print("2. Set up pre-commit: pre-commit install")
print("3. Run pre-commit on all files: make pre-commit")
else:
print("❌ Some checks failed. Please fix the issues above.")
return 1
return 0
if __name__ == "__main__":
sys.exit(main())