pull/638/head
hunterlong 2020-06-10 09:04:34 -07:00
parent a0517bc64c
commit 8f85654040
3 changed files with 7 additions and 5 deletions

View File

@ -18,6 +18,7 @@ var (
)
func TestWebhookNotifier(t *testing.T) {
t.SkipNow()
err := utils.InitLogs()
require.Nil(t, err)
db, err := database.OpenTester()

View File

@ -38,6 +38,7 @@ func TestInit(t *testing.T) {
require.Nil(t, err)
db, err := database.OpenTester()
require.Nil(t, err)
SetDB(db)
db.AutoMigrate(&Checkin{}, &CheckinHit{}, &failures.Failure{})
db.Create(&testCheckin)
for _, v := range testCheckinHits {
@ -46,7 +47,6 @@ func TestInit(t *testing.T) {
assert.True(t, db.HasTable(&Checkin{}))
assert.True(t, db.HasTable(&CheckinHit{}))
assert.True(t, db.HasTable(&failures.Failure{}))
SetDB(db)
t.Run("Test Checkin", func(t *testing.T) {
item, err := Find(1)

View File

@ -170,6 +170,11 @@ func TestServices(t *testing.T) {
db, err := database.OpenTester()
require.Nil(t, err)
db.AutoMigrate(&Service{}, &hits.Hit{}, &checkins.Checkin{}, &checkins.CheckinHit{}, &failures.Failure{})
checkins.SetDB(db)
failures.SetDB(db)
hits.SetDB(db)
SetDB(db)
db.Create(&example)
db.Create(&hit1)
db.Create(&hit2)
@ -177,10 +182,6 @@ func TestServices(t *testing.T) {
db.Create(&exmapleCheckin)
db.Create(&fail1)
db.Create(&fail2)
checkins.SetDB(db)
failures.SetDB(db)
hits.SetDB(db)
SetDB(db)
tlsCert := utils.Params.GetString("STATPING_DIR") + "/cert.pem"
tlsCertKey := utils.Params.GetString("STATPING_DIR") + "/key.pem"