Backend: Introduce optimized test config helpers to improve performance

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-09-25 23:09:52 +02:00
parent ebb0410b20
commit 660c0a89db
20 changed files with 227 additions and 99 deletions

View File

@@ -28,7 +28,13 @@ func TestMain(m *testing.M) {
log.SetLevel(logrus.TraceLevel)
event.AuditLog = log
c := config.NewTestConfig("commands")
tempDir, err := os.MkdirTemp("", "commands-test")
if err != nil {
panic(err)
}
defer os.RemoveAll(tempDir)
c := config.NewMinimalTestConfigWithDb("commands", tempDir)
get.SetConfig(c)
// Keep DB connection open for the duration of this package's tests to