Add comprehensive unit tests (issues #12-#15) #30
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
qwc-open/backive!30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "testing/unit-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
config_test.go): CreateViper idempotency, Settings.validate with valid/empty/relative paths, Load with valid YAML, missing config (panic), relative path (panic)backup_test.go): RegisterRun, Save/Load round-trip through JSON, LastRun edge cases, legacy string-based DB format, map-based DB format, bad types, bad timestampscmd/backive/main_test.go): All early-return paths — no ACTION, wrong ACTION, no UUID, unknown UUID, no matching backups, CanRun failuredatabase.goLoad() now uses mockablemockOsStat/mockOsIsNotExistinstead of directos.Stat/os.IsNotExistcalls, consistent with the pattern used elsewhereCoverage: 84.3% (backive package), 38.5% (cmd/backive package)
Closes #12, closes #13, closes #14, closes #15