- Replace estimate_block_height (PIL-based) with estimate_simple_height (word wrap)
- Update viewport filter tests to match new height-based filtering (~4 items vs 24)
- Fix CI task duplication in mise.toml (remove redundant depends)
Closes#38Closes#36
Simplified app integration tests that focus on key functionality:
- Preset loading and validation
- Content fetching (cache, fetch_all, fetch_poetry)
- Display creation and CLI flag handling
- Effect plugin discovery
Tests now use proper Mock objects with configured return values,
reducing fragility.
Status: 4 passing, 7 failing (down from 13)
The remaining failures are due to config state dependencies that
need to be mocked more carefully. These provide a solid foundation
for Phase 2 expansion.
Next: Add data source and adapter tests to reach 70% coverage target.
Move internal imports in run_pipeline_mode() to module level to support
proper mocking in integration tests. This enables more effective testing
of the app's initialization and pipeline setup.
Also simplifies the test suite to focus on key integration points.
Changes:
- Moved effects_plugins, DisplayRegistry, PerformanceMonitor, fetch functions,
and pipeline adapters to module-level imports
- Removed duplicate imports from run_pipeline_mode()
- Simplified test_app.py to focus on core functionality
All manual tests still pass (border-test preset works correctly).
Added initial integration test suite structure for engine/app.py covering:
- main() entry point preset loading
- run_pipeline_mode() pipeline setup
- Content fetching for different sources
- Display initialization
- CLI flag overrides
STATUS: Tests are currently failing because imports in run_pipeline_mode()
are internal to the function, making them difficult to patch. This requires:
1. Refactoring imports to module level, OR
2. Using more sophisticated patching strategies (patch at import time)
This provides a foundation for Phase 2. Tests will be fixed in next iteration.
PHASE 2 TASKS:
- Fix app.py test patching issues
- Add data source tests (currently 34% coverage)
- Expand adapter tests (currently 50% coverage)
- Target: 70% coverage on critical paths
- Remove ~700 lines of legacy code from app.py (run_demo_mode, run_pipeline_demo,
run_preset_mode, font picker, effects picker)
- HUD now reads metrics from pipeline context (first-class citizen) with fallback
to global monitor for backwards compatibility
- Add validate_signal_flow() for PureData-style type validation in presets
- Update MicSensor documentation (self-contained, doesn't use MicMonitor)
- Delete test_app.py (was testing removed legacy code)
- Update AGENTS.md with pipeline architecture documentation