photoprism/internal/entity/entity_test.go
Michael Mayer b4a04a478f Backend: Set test database using PHOTOPRISM_TEST_DSN
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-04-30 22:39:38 +02:00

25 lines
331 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(os.Getenv("PHOTOPRISM_TEST_DSN"))
code := m.Run()
db.Close()
os.Exit(code)
}