test: add 31 integration tests for main() detection loop - #25
Merged
Conversation
Cover the 7 critical interaction paths that unit tests miss: - Motion pipeline (detection → notification → event log → snapshot) - Sound pipeline (audio monitor → notification → cooldown) - Camera reconnection (dropped frames → reconnect → state reset) - Health checks (dead audio/web threads → restart/disable) - Dynamic settings (sensitivity/fps/ROI changes mid-run) - Display & encoding (JPEG buffer, night mode, quit on 'q') - Cleanup (KeyboardInterrupt → release camera, stop audio) Uses a MainRunner context manager that mocks all hardware deps (camera, display, audio, osascript) while keeping real FrameBuffer and EventLog. Loop exit controlled via KeyboardInterrupt from cap.read() after consuming test frames. Closes #21
johnoct
force-pushed
the
feat/integration-tests
branch
from
February 7, 2026 04:07
f2426a3 to
fd7c4ec
Compare
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
tests/test_integration.pywith 31 tests covering themain()detection loop end-to-endMainRunnercontext manager that mocks hardware deps while keeping realFrameBufferandEventLogTest plan
pytest tests/test_integration.py -v)pytest tests/ -v)Closes #21