2019-12-11 16:55:18 +01:00
|
|
|
package entity
|
2019-05-16 04:03:55 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
2019-12-11 19:11:44 +01:00
|
|
|
"github.com/sirupsen/logrus"
|
2019-05-16 04:03:55 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
2019-12-11 19:11:44 +01:00
|
|
|
log = logrus.StandardLogger()
|
|
|
|
log.SetLevel(logrus.DebugLevel)
|
2020-04-30 20:07:03 +02:00
|
|
|
|
2020-05-30 14:52:47 +02:00
|
|
|
db := InitTestDb(os.Getenv("PHOTOPRISM_TEST_DRIVER"), os.Getenv("PHOTOPRISM_TEST_DSN"))
|
|
|
|
defer db.Close()
|
2020-04-30 20:07:03 +02:00
|
|
|
|
2019-05-16 04:03:55 +02:00
|
|
|
code := m.Run()
|
2020-04-30 20:07:03 +02:00
|
|
|
|
2019-05-16 04:03:55 +02:00
|
|
|
os.Exit(code)
|
|
|
|
}
|