test: add end-to-end test for complete simulation workflow

- Created comprehensive E2E test in tests/e2e/test_full_simulation_workflow.py
- Tests new trading_days schema with manually populated data
- Verifies database helper methods work correctly
- Tests Results API structure and filtering
- Validates holdings chain across multiple days
- Checks daily P&L calculation and storage
- Verifies reasoning summary/full retrieval
- Fixed database index creation for backward compatibility with old schema
- Added migration script for cleaning old positions table
- Test uses dependency override to ensure API uses correct database

NOTE: Test does not run full simulation since model_day_executor
has not yet been migrated to new schema. Instead directly populates
trading_days table and validates API layer works correctly.

Test verifies Task 9 requirements from implementation plan.
This commit is contained in:
2025-11-04 07:30:18 -05:00
parent a673fc5008
commit f8da19f9b3
6 changed files with 645 additions and 56 deletions

View File

@@ -1,3 +1,11 @@
"""
Price data utilities and position management.
NOTE: This module uses the OLD positions table schema.
It is being replaced by the new trading_days schema.
Position update operations will be migrated to use the new schema in a future update.
"""
import os
from dotenv import load_dotenv
load_dotenv()