2019-12-11 15:55:18 +00:00
|
|
|
package entity
|
2019-05-16 02:03:55 +00:00
|
|
|
|
|
|
|
import (
|
2019-12-11 18:11:44 +00:00
|
|
|
"bytes"
|
2019-05-16 02:03:55 +00:00
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
2019-12-11 18:11:44 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
2019-05-16 02:03:55 +00:00
|
|
|
)
|
|
|
|
|
2019-12-11 18:11:44 +00:00
|
|
|
var logBuffer bytes.Buffer
|
|
|
|
|
2019-05-16 02:03:55 +00:00
|
|
|
func TestMain(m *testing.M) {
|
2019-12-11 18:11:44 +00:00
|
|
|
log = logrus.StandardLogger()
|
|
|
|
log.Out = &logBuffer
|
|
|
|
log.SetLevel(logrus.DebugLevel)
|
2020-04-30 18:07:03 +00:00
|
|
|
|
2020-04-30 19:21:09 +00:00
|
|
|
db := InitTestDb("photoprism:photoprism@tcp(photoprism-db:4001)/photoprism?parseTime=true")
|
2020-04-30 18:07:03 +00:00
|
|
|
|
2019-05-16 02:03:55 +00:00
|
|
|
code := m.Run()
|
2020-04-30 18:07:03 +00:00
|
|
|
|
|
|
|
db.Close()
|
|
|
|
|
2019-05-16 02:03:55 +00:00
|
|
|
os.Exit(code)
|
|
|
|
}
|