Add end-to-end tests for audio/video publish & subscribe#632
Open
cloudwebrtc wants to merge 4 commits intomainfrom
Open
Add end-to-end tests for audio/video publish & subscribe#632cloudwebrtc wants to merge 4 commits intomainfrom
cloudwebrtc wants to merge 4 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
livekit-rtc/tests/that exercise the full publish → SFU → subscribe path for both audio and video tracks:test_audio.py: publishes a 5-tone sine sweep (100/300/500/700/1000 Hz @ 48 kHz mono) and verifies each received tone via FFT peak detection + band-energy dominance (tolerates 15 Hz Opus jitter).test_video.py: publishes a 640×480 @ 15 fps RGBA color cycle (red/green/blue/white/black, 1 s each) and verifies the subscriber observes the colors in order using nearest-palette classification over stable runs.LIVEKIT_URL/LIVEKIT_API_KEY/LIVEKIT_API_SECRETare not set, so local and CI runs without credentials stay green.subscriber_recv_freqs.wav,subscriber_recv_frame_color_*.png) to make failures easy to debug.Motivation
We didn't have automated coverage that validated the actual media payload after it round-trips through a real SFU — unit tests only cover local-side plumbing. These tests give us a regression signal for encoder/transport/decoder behavior in the Python SDK.
Test plan
LIVEKIT_URL=... LIVEKIT_API_KEY=... LIVEKIT_API_SECRET=... pytest livekit-rtc/tests/test_audio.py -vLIVEKIT_URL=... LIVEKIT_API_KEY=... LIVEKIT_API_SECRET=... pytest livekit-rtc/tests/test_video.py -v