photoprism/internal/entity/entity_test.go
Michael Mayer 260cca91fe Backend: Refactor entity package
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-04-30 20:07:03 +02:00

32 lines
431 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 := &Gorm{
Driver: "mysql",
Dsn: "photoprism:photoprism@tcp(photoprism-db:4001)/photoprism?parseTime=true",
}
SetDbProvider(db)
Migrate()
code := m.Run()
db.Close()
os.Exit(code)
}