aboutsummaryrefslogtreecommitdiff
path: root/tests/fixtures
Commit message (Collapse)AuthorAgeFilesLines
* feat(calendar-sync): add Python helper for Google Calendar API syncCraig Jennings2026-05-194-0/+49
| | | | | | | | | | | | Google's .ics export drops per-occurrence response statuses on recurring events. When OOO auto-declines a meeting, the master event keeps PARTSTAT=ACCEPTED and declined instances inherit it. The .ics path can't filter the declines out. The API path expands recurrences server-side via singleEvents=True, and each occurrence carries its own attendees[].self.responseStatus. scripts/calendar_sync_api.py fetches events and renders them as org entries. OAuth is one-time per account. The refresh token lives at ~/.config/calendar-sync/token-<account>.json under 0600. Output matches the existing .ics shape: heading sanitization, LOCATION/ORGANIZER/STATUS/URL property drawer, HTML-stripped descriptions, org timestamps with weekday abbreviations. I wrote 30 stdlib-unittest tests against fixture JSON, covering rendering, filtering, timestamp formatting, and HTML cleanup. I left auth and HTTP uncovered — they're thin wrappers around the Google client libraries, best checked by running the script once after OAuth setup. docs/calendar-sync-api-setup.org walks through the Google Cloud OAuth client setup and the per-account auth bootstrap. .gitignore picks up Python bytecode now that the project has a Python helper. The Elisp dispatch (:fetcher 'api routing in calendar-sync.el) lands in a follow-up commit.
* feat(recording): show sinks with active audio indicators in quick-setupCraig Jennings2026-02-262-0/+60
| | | | | | | | | | Quick-setup (C-; r s) is now a two-step flow: pick a mic, then pick an audio output sink. Sinks display 󰕾/󰖁 icons with green/dim coloring to indicate which have active audio streams, with active sinks sorted to the top. The chosen sink's .monitor is set as the system audio device. This replaces the old auto-default-sink approach, letting users see where audio is actually going and pick the right sink in one command.
* feat(recording): validate system audio device before recordingCraig Jennings2026-02-263-0/+37
| | | | | | | | | | Add pre-recording validation that catches stale or drifted system audio devices before they cause silent recordings. When the default audio output changes (Bluetooth reconnect, device switch) between setup and recording, the monitor device is auto-updated. Warns if no audio is currently playing through the monitored sink. Co-Authored-By: Craig Jennings <c@cjennings.net>
* fix(recording): Fix phone call audio capture with amix filterCraig Jennings2025-11-142-0/+0
| | | | | | | | | | | | | | | | Phone calls were not capturing the remote person's voice due to severe volume loss (44 dB) when using the amerge+pan FFmpeg filter combination. Changes: - Replace amerge+pan with amix filter (provides 44 dB volume improvement) - Increase default system volume from 0.5 to 2.0 for better capture levels - Add diagnostic tool to show active audio playback (C-; r w) - Add integration test with real voice recording - Fix batch mode compatibility for test execution The amix filter properly mixes microphone and system monitor inputs without the massive volume loss that amerge+pan caused. Verified with automated integration test showing perfect transcription of test audio.
* Revert "checking in modified/removed tests and other misc changes"Craig Jennings2025-11-149-0/+34
| | | | This reverts commit 1218bae708a6755e3628f15fef58e6806ac81039.
* checking in modified/removed tests and other misc changesCraig Jennings2025-11-149-34/+0
|
* test: Add comprehensive test suite for LanguageTool grammar checkingCraig Jennings2025-11-043-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Created complete test coverage for the LanguageTool integration: Unit Tests (test-flycheck-languagetool-setup.el): - 6 tests covering installation and configuration - Verifies LanguageTool binary availability - Checks wrapper script exists and is executable - Validates wrapper script structure (shebang, imports) - Tests error handling for missing arguments - All tests pass ✓ Integration Tests (test-integration-grammar-checking.el): - 9 tests covering end-to-end grammar checking workflow - Tests wrapper script with real LanguageTool execution - Validates output format (filename:line:column: message) - Tests normal cases (error detection, formatting) - Tests boundary cases (empty files, single word, multiple paragraphs) - Tests error cases (nonexistent files, missing arguments) - Uses real test fixtures with known grammar errors - All tests pass ✓ (takes ~35 seconds due to LanguageTool execution) Test Fixtures (tests/fixtures/grammar-*.txt): - grammar-errors-basic.txt: Common errors (subject-verb, could of, etc.) - grammar-errors-punctuation.txt: Punctuation and spacing errors - grammar-correct.txt: Clean text with no errors Testing Philosophy Applied: - Focus on OUR code (wrapper script), not flycheck internals - Trust external frameworks work correctly - Test real integration (wrapper → LanguageTool → output) - No mocking of domain logic, only external side-effects - Clear test categories: Normal, Boundary, Error cases - Comprehensive docstrings listing integrated components - Deterministic tests using real fixtures Usage: make test-file FILE=test-flycheck-languagetool-setup.el make test-file FILE=test-integration-grammar-checking.el make test-integration # Includes grammar integration test Tests automatically discovered by Makefile wildcards.
* test: Add comprehensive test suite for video-audio-recording moduleCraig Jennings2025-11-036-0/+17
Added 83 test cases across 9 test files with 100% pass rate, covering device detection, parsing, grouping, and complete workflow integration. ## What Was Done ### Refactoring for Testability - Extracted `cj/recording--parse-pactl-output` from `cj/recording-parse-sources` - Separated parsing logic from shell command execution - Enables testing with fixture data instead of live system calls ### Test Fixtures Created - `pactl-output-normal.txt` - All device types (built-in, USB, Bluetooth) - `pactl-output-empty.txt` - Empty output - `pactl-output-single.txt` - Single device - `pactl-output-monitors-only.txt` - Only monitor devices - `pactl-output-inputs-only.txt` - Only input devices - `pactl-output-malformed.txt` - Invalid/malformed output ### Unit Tests (8 files, 78 test cases) 1. **test-video-audio-recording-friendly-state.el** (10 tests) - State name conversion: SUSPENDED→Ready, RUNNING→Active 2. **test-video-audio-recording-parse-pactl-output.el** (14 tests) - Parse raw pactl output into structured data - Handle empty, malformed, and mixed valid/invalid input 3. **test-video-audio-recording-parse-sources.el** (6 tests) - Shell command wrapper testing with mocked output 4. **test-video-audio-recording-detect-mic-device.el** (13 tests) - Documents bugs: Returns ID numbers instead of device names - Doesn't filter monitors (legacy function, not actively used) 5. **test-video-audio-recording-detect-system-device.el** (13 tests) - Works correctly: Returns full device names - Tests monitor detection with various device types 6. **test-video-audio-recording-group-devices-by-hardware.el** (12 tests) - CRITICAL: Bluetooth MAC address normalization (colons vs underscores) - Device pairing logic (mic + monitor from same hardware) - Friendly name assignment - Filters incomplete devices 7. **test-video-audio-recording-check-ffmpeg.el** (3 tests) - ffmpeg availability detection 8. **test-video-audio-recording-get-devices.el** (7 tests) - Auto-detection fallback logic - Error handling for incomplete detection ### Integration Tests (1 file, 5 test cases) 9. **test-integration-recording-device-workflow.el** (5 tests) - Complete workflow: parse → group → friendly names - Bluetooth MAC normalization end-to-end - Incomplete device filtering across components - Malformed data graceful handling ## Key Testing Insights ### Bugs Documented - `cj/recording-detect-mic-device` has bugs (returns IDs, doesn't filter monitors) - These functions appear to be legacy code not used by main workflow - Tests document current behavior to catch regressions if fixed ### Critical Features Validated - **Bluetooth MAC normalization**: Input uses colons (00:1B:66:C0:91:6D), output uses underscores (00_1B_66_C0_91_6D), grouping normalizes correctly - **Device pairing**: Only devices with BOTH mic and monitor are included - **Friendly names**: USB/PCI/Bluetooth patterns correctly identified ### Test Coverage - Normal cases: Valid inputs, typical workflows - Boundary cases: Empty, single device, incomplete pairs - Error cases: Malformed input, missing devices, partial detection ## Test Execution All tests pass: 9/9 files, 83/83 test cases (100% pass rate) ```bash make test-file FILE=test-video-audio-recording-*.el # All pass individually # Integration test also passes make test-file FILE=test-integration-recording-device-workflow.el ```