chore: Enhance test coverage across various handlers and services

- Added tests for transient SQLite errors in emergency_handler_test.go.
- Introduced validation tests for provider errors in notification_provider_handler_validation_test.go.
- Implemented helper tests for settings handling in settings_handler_helpers_test.go.
- Expanded backup_handler_test.go to include SQLite database setup and validation.
- Improved system_permissions_handler_test.go with additional path repair tests.
- Updated backup_service_test.go to ensure proper database handling and error checks during backup operations.
- Refined import_handler_test.go with additional session validation tests.
This commit is contained in:
GitHub Actions
2026-02-16 20:32:16 +00:00
parent 6944488be0
commit 716ec91f8f
15 changed files with 580 additions and 197 deletions
+4 -4
View File
@@ -196,7 +196,7 @@ func TestStartupVerification_MissingTables(t *testing.T) {
func TestMain_MigrateCommand_InProcess(t *testing.T) {
tmp := t.TempDir()
dbPath := filepath.Join(tmp, "data", "test.db")
if err := os.MkdirAll(filepath.Dir(dbPath), 0o755); err != nil {
if err := os.MkdirAll(filepath.Dir(dbPath), 0o750); err != nil {
t.Fatalf("mkdir db dir: %v", err)
}
@@ -242,7 +242,7 @@ func TestMain_MigrateCommand_InProcess(t *testing.T) {
func TestMain_ResetPasswordCommand_InProcess(t *testing.T) {
tmp := t.TempDir()
dbPath := filepath.Join(tmp, "data", "test.db")
if err := os.MkdirAll(filepath.Dir(dbPath), 0o755); err != nil {
if err := os.MkdirAll(filepath.Dir(dbPath), 0o750); err != nil {
t.Fatalf("mkdir db dir: %v", err)
}
@@ -302,7 +302,7 @@ func TestMain_DefaultStartupGracefulShutdown_Subprocess(t *testing.T) {
tmp := t.TempDir()
dbPath := filepath.Join(tmp, "data", "test.db")
if err := os.MkdirAll(filepath.Dir(dbPath), 0o755); err != nil {
if err := os.MkdirAll(filepath.Dir(dbPath), 0o750); err != nil {
t.Fatalf("mkdir db dir: %v", err)
}
@@ -328,7 +328,7 @@ func TestMain_DefaultStartupGracefulShutdown_Subprocess(t *testing.T) {
func TestMain_DefaultStartupGracefulShutdown_InProcess(t *testing.T) {
tmp := t.TempDir()
dbPath := filepath.Join(tmp, "data", "test.db")
if err := os.MkdirAll(filepath.Dir(dbPath), 0o755); err != nil {
if err := os.MkdirAll(filepath.Dir(dbPath), 0o750); err != nil {
t.Fatalf("mkdir db dir: %v", err)
}