5858# Test constants
5959BACKEND_URL = "http://localhost:8001" # Test backend port
6060TEST_AUDIO_PATH = tests_dir .parent .parent .parent / "extras/test-audios/DIY Experts Glass Blowing_16khz_mono_4min.wav"
61- MAX_STARTUP_WAIT = 120 # seconds
61+ MAX_STARTUP_WAIT = 60 # seconds
6262PROCESSING_TIMEOUT = 300 # seconds for audio processing (5 minutes)
6363
6464
@@ -851,10 +851,16 @@ def wait_for_memory_processing(self, client_id: str, timeout: int = 120):
851851
852852 if response .status_code == 200 :
853853 data = response .json ()
854+
855+ # DEBUG: Log full API response to see exactly what we're getting
856+ logger .info (f"🔍 Full processor status API response: { data } " )
857+
854858 stages = data .get ("stages" , {})
855859
856860 # Check if memory stage is complete
857861 memory_stage = stages .get ("memory" , {})
862+ logger .info (f"🧠 Memory stage data: { memory_stage } " )
863+
858864 if memory_stage .get ("completed" , False ):
859865 logger .info (f"✅ Memory processing completed for client_id: { client_id } " )
860866 memory_processing_complete = True
@@ -873,6 +879,8 @@ def wait_for_memory_processing(self, client_id: str, timeout: int = 120):
873879 error = stage_info .get ("error" )
874880 status = "✅" if completed else "❌" if error else "⏳"
875881 logger .info (f" { status } { stage_name } : { 'completed' if completed else 'error' if error else 'processing' } " )
882+ # DEBUG: Show all fields in memory stage
883+ logger .info (f" All memory stage fields: { stage_info } " )
876884
877885 else :
878886 logger .warning (f"❌ Processor status API call failed with status: { response .status_code } " )
@@ -937,6 +945,10 @@ def test_runner():
937945def test_full_pipeline_integration (test_runner ):
938946 """Test the complete audio processing pipeline."""
939947 try :
948+ # Test timing tracking
949+ test_start_time = time .time ()
950+ phase_times = {}
951+
940952 # Immediate logging to debug environment
941953 logger .info ("=" * 80 )
942954 logger .info ("🚀 STARTING INTEGRATION TEST" )
@@ -946,18 +958,54 @@ def test_full_pipeline_integration(test_runner):
946958 logger .info (f"CI environment: { os .environ .get ('CI' , 'NOT SET' )} " )
947959 logger .info (f"GITHUB_ACTIONS: { os .environ .get ('GITHUB_ACTIONS' , 'NOT SET' )} " )
948960
949- # Setup
961+ # Phase 1: Environment setup
962+ phase_start = time .time ()
963+ logger .info ("📋 Phase 1: Setting up test environment..." )
950964 test_runner .setup_environment ()
965+ phase_times ['env_setup' ] = time .time () - phase_start
966+ logger .info (f"✅ Environment setup completed in { phase_times ['env_setup' ]:.2f} s" )
967+
968+ # Phase 2: Service startup
969+ phase_start = time .time ()
970+ logger .info ("🐳 Phase 2: Starting services..." )
951971 test_runner .start_services ()
972+ phase_times ['service_startup' ] = time .time () - phase_start
973+ logger .info (f"✅ Service startup completed in { phase_times ['service_startup' ]:.2f} s" )
974+
975+ # Phase 3: Wait for services
976+ phase_start = time .time ()
977+ logger .info ("⏳ Phase 3: Waiting for services to be ready..." )
952978 test_runner .wait_for_services ()
979+ phase_times ['service_readiness' ] = time .time () - phase_start
980+ logger .info (f"✅ Service readiness check completed in { phase_times ['service_readiness' ]:.2f} s" )
981+
982+ # Phase 4: Authentication
983+ phase_start = time .time ()
984+ logger .info ("🔑 Phase 4: Authentication..." )
953985 test_runner .authenticate ()
986+ phase_times ['authentication' ] = time .time () - phase_start
987+ logger .info (f"✅ Authentication completed in { phase_times ['authentication' ]:.2f} s" )
954988
955- # Test audio processing
989+ # Phase 5: Audio upload and processing
990+ phase_start = time .time ()
991+ logger .info ("📤 Phase 5: Audio upload..." )
956992 client_id = test_runner .upload_test_audio ()
993+ phase_times ['audio_upload' ] = time .time () - phase_start
994+ logger .info (f"✅ Audio upload completed in { phase_times ['audio_upload' ]:.2f} s" )
995+
996+ # Phase 6: Transcription processing
997+ phase_start = time .time ()
998+ logger .info ("🎤 Phase 6: Transcription processing..." )
957999 conversation , transcription = test_runner .verify_processing_results (client_id )
1000+ phase_times ['transcription_processing' ] = time .time () - phase_start
1001+ logger .info (f"✅ Transcription processing completed in { phase_times ['transcription_processing' ]:.2f} s" )
9581002
959- # Validate memory extraction
1003+ # Phase 7: Memory extraction
1004+ phase_start = time .time ()
1005+ logger .info ("🧠 Phase 7: Memory extraction..." )
9601006 memories = test_runner .validate_memory_extraction (client_id )
1007+ phase_times ['memory_extraction' ] = time .time () - phase_start
1008+ logger .info (f"✅ Memory extraction completed in { phase_times ['memory_extraction' ]:.2f} s" )
9611009
9621010 # Basic assertions
9631011 assert conversation is not None
@@ -1003,10 +1051,25 @@ def test_full_pipeline_integration(test_runner):
10031051"""
10041052 assert False , error_msg
10051053
1006- # Log success
1054+ # Calculate total test time
1055+ total_test_time = time .time () - test_start_time
1056+ phase_times ['total_test' ] = total_test_time
1057+
1058+ # Log success with detailed timing
10071059 logger .info ("=" * 80 )
10081060 logger .info ("🎉 INTEGRATION TEST PASSED!" )
10091061 logger .info ("=" * 80 )
1062+ logger .info (f"⏱️ TIMING BREAKDOWN:" )
1063+ logger .info (f" 📋 Environment Setup: { phase_times ['env_setup' ]:>6.2f} s" )
1064+ logger .info (f" 🐳 Service Startup: { phase_times ['service_startup' ]:>6.2f} s" )
1065+ logger .info (f" ⏳ Service Readiness: { phase_times ['service_readiness' ]:>6.2f} s" )
1066+ logger .info (f" 🔑 Authentication: { phase_times ['authentication' ]:>6.2f} s" )
1067+ logger .info (f" 📤 Audio Upload: { phase_times ['audio_upload' ]:>6.2f} s" )
1068+ logger .info (f" 🎤 Transcription: { phase_times ['transcription_processing' ]:>6.2f} s" )
1069+ logger .info (f" 🧠 Memory Extraction: { phase_times ['memory_extraction' ]:>6.2f} s" )
1070+ logger .info (f" { '─' * 35 } " )
1071+ logger .info (f" 🏁 TOTAL TEST TIME: { total_test_time :>6.2f} s ({ total_test_time / 60 :.1f} m)" )
1072+ logger .info ("" )
10101073 logger .info (f"📊 Test Results:" )
10111074 logger .info (f" ✅ Audio file processed successfully" )
10121075 logger .info (f" ✅ Transcription generated: { len (transcription )} characters" )
0 commit comments