mirror of
https://github.com/LearningCircuit/local-deep-research.git
synced 2026-06-16 03:51:07 +03:00
* Clean up temporary JavaScript files and reorganize test files - Remove temp_js_*.js files that appear to be development iterations - Move test_simple_cost.js to tests/ui_tests/ where it belongs with other UI tests - Move package.json to tests/ directory since it's only used for test dependencies (Puppeteer) - These changes clean up the root directory from temporary development files * chore: Clean up root directory and organize dev scripts - Remove redundant app.py (was calling non-existent local_deep_research.main()) - Move development utility scripts to scripts/dev/: - kill_servers.py: Flask server process management - run_tests.py: Test runner with coverage - debug_pytest.py: CI test debugging - Fix kill_servers.py to use correct server command (local_deep_research.web.app) * fix: Update UI tests workflow to use tests/package.json The npm install command was looking for package.json in the root directory, but it was moved to tests/ directory. Update the workflow to install npm dependencies from the correct location. * fix: Update full tests workflow to use tests/package.json Another npm install command in the full tests workflow was looking for package.json in the root directory. Update it to install from tests/ directory where the package.json is located.
50 lines
1.4 KiB
Python
50 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.
|
|
"""
|
|
|
|
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())
|