mirror of
https://github.com/LearningCircuit/local-deep-research.git
synced 2026-06-16 12:02:34 +03:00
* refactor: cleanup remaining verified dead code across 5 areas Dead templates, functions, storage ABCs, eslint duplicate, dev scripts. All verified by 40 agents (20 scanning + 20 verification). * revert: keep 3 dev scripts that have active references - regenerate_golden_master.py: called by pre-commit hook .pre-commit-hooks/check-golden-master-settings.py - restart_server.sh: documented in API testing guide, examples, and multiple README files - run_tests.py: referenced in CONTRIBUTING.md testing section Added inline comments noting the references so future cleanup attempts don't remove them without updating dependents. * revert: keep restart_server_debug.sh dev script * revert: keep debug_pytest.py and stop_server.sh dev scripts Small utility scripts that cost nothing to keep and are useful for developers debugging CI failures and managing the dev server. * docs: add do-not-remove comments to all dev scripts Each script now documents why it must be kept: - regenerate_golden_master.py: pre-commit hook dependency - restart_server.sh: documented in API guides and examples - restart_server_debug.sh: companion to restart_server.sh - run_tests.py: referenced in CONTRIBUTING.md - debug_pytest.py: developer utility for CI failure reproduction - stop_server.sh: companion to restart_server.sh
52 lines
1.4 KiB
Python
52 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Run tests for Local Deep Research.
|
|
|
|
This script runs pytest with appropriate configuration for the project.
|
|
|
|
Referenced in CONTRIBUTING.md — do not delete without updating that file.
|
|
"""
|
|
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def main():
|
|
"""Run the test suite with appropriate settings."""
|
|
# Get the project root directory
|
|
project_root = Path(__file__).parent.absolute()
|
|
|
|
# Ensure PYTHONPATH includes the project root for proper imports
|
|
os.environ["PYTHONPATH"] = str(project_root)
|
|
|
|
# Configure pytest arguments
|
|
pytest_args = [
|
|
sys.executable, # Use Python interpreter
|
|
"-m", # Run module
|
|
"pytest", # Call pytest
|
|
"--verbose", # Verbose output
|
|
"--color=yes", # Force colored output
|
|
"--cov=src", # Measure coverage for src directory
|
|
"--cov-report=term", # Report coverage in terminal
|
|
"--cov-report=html:coverage_html", # Also generate HTML report
|
|
"--cov-config=.coveragerc", # Use the coverage configuration file
|
|
]
|
|
|
|
# Add any command line arguments passed to this script
|
|
pytest_args.extend(sys.argv[1:])
|
|
|
|
# Print the command being run
|
|
print(f"Running: {' '.join(pytest_args)}")
|
|
|
|
# Run pytest and capture the return code
|
|
result = subprocess.run(pytest_args)
|
|
|
|
# Return the pytest exit code
|
|
return result.returncode
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|