Charles P. Cross
|
ba8beb53b3
|
test(coverage): add tests to meet 45% CI threshold
Add comprehensive test coverage for previously untested functions:
internal/debug/debug_test.go:
- TestSetVerbose: tests SetVerbose() and its effect on Enabled()
- TestSetQuietAndIsQuiet: tests SetQuiet() and IsQuiet() functions
- TestPrintNormal: tests quiet mode suppression of normal output
- TestPrintlnNormal: tests quiet mode suppression of println output
internal/export/config_test.go (new file):
- TestLoadConfig: comprehensive tests for LoadConfig() including:
- Default values when no config exists
- Loading custom policies (both regular and auto-export)
- Loading retry attempts, backoff, skip encoding errors, write manifest
- Handling invalid/malformed config values gracefully
internal/export/policy_test.go:
- TestErrorPolicyString: tests String() method on ErrorPolicy
- TestNewManifest: tests manifest creation with proper defaults
- TestWriteManifest: tests manifest file writing and error handling
These tests bring coverage from 44.8% to 45.0%, meeting the CI threshold.
|
2025-12-18 17:45:49 -05:00 |
|
Steve Yegge
|
95cbcf4fbc
|
Centralize BD_DEBUG logging into internal/debug package
- Created internal/debug package with Enabled(), Logf(), Printf()
- Added comprehensive unit tests for debug package
- Replaced 50+ scattered os.Getenv("BD_DEBUG") checks across 9 files
- Centralized debug logic for easier maintenance and testing
- All tests passing, behavior unchanged
Closes bd-fb95094c.5
|
2025-11-06 20:14:34 -08:00 |
|