beads/cmd/bd
Steve Yegge 33412871eb Add comprehensive test coverage for auto-flush feature
Implements bd-42: Add test coverage for auto-flush feature

Created cmd/bd/main_test.go with 11 comprehensive test functions:
- TestAutoFlushDirtyMarking: Verifies markDirtyAndScheduleFlush() marks DB as dirty
- TestAutoFlushDisabled: Tests --no-auto-flush flag disables feature
- TestAutoFlushDebounce: Tests rapid operations result in single flush
- TestAutoFlushClearState: Tests clearAutoFlushState() resets state
- TestAutoFlushOnExit: Tests flush happens on program exit
- TestAutoFlushConcurrency: Tests concurrent operations don't cause races
- TestAutoFlushStoreInactive: Tests flush skips when store is inactive
- TestAutoFlushJSONLContent: Tests flushed JSONL has correct content
- TestAutoFlushErrorHandling: Tests error scenarios (permissions, etc.)
- TestAutoImportIfNewer: Tests auto-import when JSONL is newer than DB
- TestAutoImportDisabled: Tests --no-auto-import flag disables auto-import

Coverage results:
- markDirtyAndScheduleFlush: 100%
- clearAutoFlushState: 100%
- flushToJSONL: 67.6%
- autoImportIfNewer: 66.1% (up from 0%)

All tests pass. Auto-flush feature is now thoroughly tested.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 23:38:24 -07:00
..
dep.go Fix critical race conditions in auto-flush feature 2025-10-13 22:34:12 -07:00
export.go Add ID space partitioning and improve auto-flush reliability 2025-10-13 23:31:51 -07:00
export_import_test.go Pre-release fixes and polish for open source launch 2025-10-12 17:28:48 -07:00
import.go Fix critical race conditions in auto-flush feature 2025-10-13 22:34:12 -07:00
import_collision_test.go Pre-release fixes and polish for open source launch 2025-10-12 17:28:48 -07:00
init.go Address remaining golangci-lint findings 2025-10-12 09:48:22 -07:00
main.go Add ID space partitioning and improve auto-flush reliability 2025-10-13 23:31:51 -07:00
main_test.go Add comprehensive test coverage for auto-flush feature 2025-10-13 23:38:24 -07:00
quickstart.go Implement auto-import to complete automatic git sync workflow 2025-10-13 22:48:30 -07:00
ready.go Implement JSONL export/import and shift to text-first architecture 2025-10-12 01:17:50 -07:00
version.go Pre-release fixes and polish for open source launch 2025-10-12 17:28:48 -07:00