photoprism/internal/entity/entity_test.go

30 lines
358 B
Go
Raw Normal View History

package entity
import (
"os"
"testing"
"github.com/sirupsen/logrus"
)
func TestMain(m *testing.M) {
log = logrus.StandardLogger()
log.SetLevel(logrus.DebugLevel)
dsn := os.Getenv("PHOTOPRISM_TEST_DSN")
if dsn == "" {
panic("database dsn is empty")
}
db := InitTestDb(dsn)
code := m.Run()
if db != nil {
db.Close()
}
os.Exit(code)
}