2020-01-05 14:18:40 +01:00
|
|
|
package query
|
2019-12-11 08:18:48 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/sirupsen/logrus"
|
2022-03-29 00:21:50 +02:00
|
|
|
|
|
|
|
"github.com/photoprism/photoprism/internal/entity"
|
2019-12-11 08:18:48 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
|
|
|
log = logrus.StandardLogger()
|
2022-03-02 12:20:02 +01:00
|
|
|
log.SetLevel(logrus.TraceLevel)
|
2020-04-30 22:39:38 +02:00
|
|
|
|
2022-03-29 00:21:50 +02:00
|
|
|
db := entity.InitTestDb(
|
|
|
|
os.Getenv("PHOTOPRISM_TEST_DRIVER"),
|
|
|
|
os.Getenv("PHOTOPRISM_TEST_DSN"))
|
2020-07-21 14:43:45 +02:00
|
|
|
|
2020-05-30 14:52:47 +02:00
|
|
|
defer db.Close()
|
2020-04-30 22:39:38 +02:00
|
|
|
|
2019-12-11 08:18:48 +01:00
|
|
|
code := m.Run()
|
2020-04-30 22:39:38 +02:00
|
|
|
|
2019-12-11 08:18:48 +01:00
|
|
|
os.Exit(code)
|
|
|
|
}
|