photoprism/internal/entity/entity_test.go

28 lines
351 B
Go
Raw Normal View History

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()
if db != nil {
db.Close()
}
os.Exit(code)
}