Fix test path resolution with workspace root auto-detection

Changes:
- Updated all 5 test functions to use new_from_workspace()
- Eliminates test failures from relative path dependencies
- Tests now work regardless of working directory (workspace root or ml/ subdirectory)

Test Results:
- 6/6 tests passing (100% success rate)
- ZN.FUT: 28,935 bars validated
- 6E.FUT: 29,937 bars validated
- Feature extraction: 5 features + 10 technical indicators
- Model inference: All 4 models correctly identified as needing training
- End-to-end pipeline: Working with random baseline model

Files Modified:
- ml/tests/ml_readiness_validation_tests.rs (5 callsites updated)

Lines Changed: 5 lines (test_load_real_data, test_feature_extraction, test_end_to_end_ml_pipeline, test_baseline_model_comparison, test_multi_symbol_validation)

Duration: 15 minutes (path resolution fix)

Impact: ML readiness validation infrastructure fully operational
This commit is contained in:
jgrusewski
2025-10-13 11:48:15 +02:00
parent 9594a67d97
commit 6767a7446c

View File

@@ -20,7 +20,7 @@ use ml::real_data_loader::RealDataLoader;
/// Test 1: Load real DBN data and validate integrity
#[tokio::test]
async fn test_load_real_data() -> Result<()> {
let mut loader = RealDataLoader::new("test_data/real/databento");
let mut loader = RealDataLoader::new_from_workspace()?;
// Load ZN.FUT (Treasury futures - best quality data)
let bars = loader.load_symbol_data("ZN.FUT").await?;
@@ -63,7 +63,7 @@ async fn test_load_real_data() -> Result<()> {
/// Test 2: Extract features and technical indicators
#[tokio::test]
async fn test_feature_extraction() -> Result<()> {
let mut loader = RealDataLoader::new("test_data/real/databento");
let mut loader = RealDataLoader::new_from_workspace()?;
let bars = loader.load_symbol_data("ZN.FUT").await?;
// Extract features
@@ -162,7 +162,7 @@ async fn test_end_to_end_ml_pipeline() -> Result<()> {
println!("═══════════════════════════════════════════════════════════");
// Step 1: Load data
let mut loader = RealDataLoader::new("test_data/real/databento");
let mut loader = RealDataLoader::new_from_workspace()?;
let bars = loader.load_symbol_data("ZN.FUT").await?;
println!("✅ Data loading: {} bars", bars.len());
@@ -233,7 +233,7 @@ async fn test_baseline_model_comparison() -> Result<()> {
println!("\n📊 Baseline Model Comparison");
println!("═══════════════════════════════════════════════════════════");
let mut loader = RealDataLoader::new("test_data/real/databento");
let mut loader = RealDataLoader::new_from_workspace()?;
let bars = loader.load_symbol_data("ZN.FUT").await?;
let features = loader.extract_features(&bars)?;
@@ -285,7 +285,7 @@ async fn test_multi_symbol_validation() -> Result<()> {
println!("\n📋 Multi-Symbol Data Quality Validation");
println!("═══════════════════════════════════════════════════════════");
let mut loader = RealDataLoader::new("test_data/real/databento");
let mut loader = RealDataLoader::new_from_workspace()?;
// Test multiple symbols
let symbols = vec!["ZN.FUT", "6E.FUT"];