Files
live-voice-chat/tests

Voice-chat tests

Two tiers.

Unit tests — fast, GPU-free

python -m pytest tests/unit -v

These exercise pure logic: config parsing, prompt derivation, LoRA spec parsing, frame-length fitting, library round-robin selection. They do not touch CUDA, Wan2.2, MuseTalk, or ffmpeg. Safe to run on Windows, outside Docker, without any models installed.

Component tests — slow, GPU-required, run inside Docker

Each script in tests/component/ exercises one subsystem end-to-end against the real models. They are ordered to match the implementation phases:

Script Phase Tests
test_01_video_skeleton.py 1 VideoEngine loads, config gate respected
test_02_wan22_loras.py 2 Wan2.2 pipeline loads, LoRA stack applies
test_03_idle_clip.py 3 set_avatar → idle MP4, written to disk for eyeballing
test_04_library_prebake.py 4 library mode pre-bakes N base clips
test_05_musetalk_lipsync.py 5 MuseTalk lip-sync on library frames + ffmpeg mux
test_06_reflective.py 6 reflective mode: fresh Wan2.2 per reply
test_07_endpoints.py 7 HTTP endpoints return sane responses
test_08_lora_reload.py 8 /api/reload-loras swaps LoRAs live

Run one:

# Inside the container:
docker compose exec voice-chat python -m tests.component.test_03_idle_clip

Run all (slow, ~20+ minutes on 5090):

docker compose exec voice-chat python -m tests.component.run_all

Each component script writes its artifacts (MP4s, PNG frame dumps, logs) to tests/component/_out/ so you can visually inspect results. That directory is gitignored.