photoprism/internal/entity/entity_test.go
Michael Mayer c30476f120 Backend: Refactor test db initialization
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-04-30 21:21:09 +02:00

25 lines
372 B
Go

package entity
import (
"bytes"
"os"
"testing"
"github.com/sirupsen/logrus"
)
var logBuffer bytes.Buffer
func TestMain(m *testing.M) {
log = logrus.StandardLogger()
log.Out = &logBuffer
log.SetLevel(logrus.DebugLevel)
db := InitTestDb("photoprism:photoprism@tcp(photoprism-db:4001)/photoprism?parseTime=true")
code := m.Run()
db.Close()
os.Exit(code)
}