photoprism/internal/service/cluster/node/node_test.go
Michael Mayer e4f78a19ac Backend: Remove temporary SQLite files before running unit tests
Signed-off-by: Michael Mayer <michael@photoprism.app>
2025-09-29 11:49:10 +02:00

22 lines
437 B
Go

package node
import (
"os"
"testing"
"github.com/photoprism/photoprism/pkg/fs"
)
// TestMain ensures SQLite test DB artifacts are purged after the suite runs.
func TestMain(m *testing.M) {
// Remove temporary SQLite files before running the tests.
fs.PurgeTestDbFiles(".", false)
// Run unit tests.
code := m.Run()
// Remove temporary SQLite files after running the tests.
fs.PurgeTestDbFiles(".", false)
os.Exit(code)
}