2021-09-18 15:32:39 +02:00
|
|
|
package search
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/photoprism/photoprism/internal/entity"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
|
|
|
log = logrus.StandardLogger()
|
2022-03-02 12:20:02 +01:00
|
|
|
log.SetLevel(logrus.TraceLevel)
|
2021-09-18 15:32:39 +02:00
|
|
|
|
2022-03-29 00:21:50 +02:00
|
|
|
db := entity.InitTestDb(
|
|
|
|
os.Getenv("PHOTOPRISM_TEST_DRIVER"),
|
|
|
|
os.Getenv("PHOTOPRISM_TEST_DSN"))
|
2021-09-18 15:32:39 +02:00
|
|
|
|
|
|
|
defer db.Close()
|
|
|
|
|
|
|
|
code := m.Run()
|
|
|
|
|
|
|
|
os.Exit(code)
|
|
|
|
}
|