reorganize: move all test scripts to tests/ directory

- Moved 8 root-level test scripts + 2 from bot/ to tests/
- Moved run_rocinante_test.sh runner script to tests/
- Added tests/README.md documenting each test's purpose, type, and requirements
- Added test_pfp_context.py and test_rocinante_comparison.py (previously untracked)
This commit is contained in:
2026-03-04 00:18:21 +02:00
parent 431f675fc7
commit fdde12c03d
12 changed files with 730 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
#!/usr/bin/env python3
"""
Test audio playback in an active voice session.
This sends text to the TTS and should be heard in Discord voice.
"""
import asyncio
import sys
sys.path.insert(0, '/app')
from utils.voice_manager import voice_manager
async def test_voice_playback():
print("🎤 Testing voice playback in active session...")
if not voice_manager.active_session:
print("❌ No active voice session! Use '!miku join' first.")
return
if not voice_manager.active_session.tts_streamer:
print("❌ TTS streamer not initialized!")
return
if not voice_manager.active_session.voice_client:
print("❌ Not connected to voice!")
return
print(f"✓ Active session in: {voice_manager.active_session.voice_channel.name}")
print(f"✓ Voice client connected: {voice_manager.active_session.voice_client.is_connected()}")
print(f"✓ Voice client playing: {voice_manager.active_session.voice_client.is_playing()}")
try:
test_text = "Hello! This is a test of the voice chat system."
print(f"\n📤 Speaking: '{test_text}'")
await voice_manager.active_session.tts_streamer.stream_text(test_text)
print("✓ Text sent to TTS!")
print("⏳ Audio should be playing in Discord voice channel...")
print(" (Wait a few seconds for TTS processing and playback)")
await asyncio.sleep(5)
print("✅ Test complete!")
except Exception as e:
print(f"❌ Error: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
asyncio.run(test_voice_playback())