mirror of
https://github.com/photoprism/photoprism.git
synced 2025-10-30 03:41:57 +08:00
Backend: Introduce optimized test config helpers to improve performance
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user