mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-08 11:47:24 -04:00
feat: add standardized testing scripts and documentation
Add comprehensive suite of testing scripts for different workflows: - test.sh: Interactive menu for all testing operations - quick_test.sh: Fast unit test feedback (~10-30s) - run_tests.sh: Main test runner with full configuration options - coverage_report.sh: Coverage analysis with HTML/JSON/terminal reports - ci_test.sh: CI/CD optimized testing with JUnit/coverage XML output Features: - Colored terminal output with clear error messages - Consistent option flags across all scripts - Support for test markers (unit, integration, e2e, slow, etc.) - Parallel execution support - Coverage thresholds (default: 85%) - Virtual environment and dependency checks Documentation: - Update CLAUDE.md with testing section and examples - Expand docs/developer/testing.md with comprehensive guide - Add scripts/README.md with quick reference All scripts are tested and executable. This standardizes the testing process for local development, CI/CD, and pull request workflows.
This commit is contained in:
@@ -26,7 +26,7 @@ def test_worker_prepares_data_before_execution(tmp_path):
|
||||
|
||||
def mock_prepare(*args, **kwargs):
|
||||
prepare_called.append(True)
|
||||
return (["2025-10-01"], []) # Return available dates, no warnings
|
||||
return (["2025-10-01"], [], {}) # Return available dates, no warnings, no completion skips
|
||||
|
||||
worker._prepare_data = mock_prepare
|
||||
|
||||
@@ -55,7 +55,7 @@ def test_worker_handles_no_available_dates(tmp_path):
|
||||
worker = SimulationWorker(job_id=job_id, db_path=db_path)
|
||||
|
||||
# Mock _prepare_data to return empty dates
|
||||
worker._prepare_data = Mock(return_value=([], []))
|
||||
worker._prepare_data = Mock(return_value=([], [], {}))
|
||||
|
||||
# Run worker
|
||||
result = worker.run()
|
||||
@@ -84,7 +84,7 @@ def test_worker_stores_warnings(tmp_path):
|
||||
|
||||
# Mock _prepare_data to return warnings
|
||||
warnings = ["Rate limited", "Skipped 1 date"]
|
||||
worker._prepare_data = Mock(return_value=(["2025-10-01"], warnings))
|
||||
worker._prepare_data = Mock(return_value=(["2025-10-01"], warnings, {}))
|
||||
worker._execute_date = Mock()
|
||||
|
||||
# Run worker
|
||||
|
||||
Reference in New Issue
Block a user