mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix gofmt, add test, correct noted concerns with default value
This commit is contained in:
parent
18c73631ea
commit
c4dcf5a4ee
@ -6,7 +6,6 @@ import (
|
|||||||
|
|
||||||
"github.com/grafana/grafana/pkg/log"
|
"github.com/grafana/grafana/pkg/log"
|
||||||
"github.com/grafana/grafana/pkg/models"
|
"github.com/grafana/grafana/pkg/models"
|
||||||
|
|
||||||
"github.com/grafana/grafana/pkg/services/alerting"
|
"github.com/grafana/grafana/pkg/services/alerting"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -179,5 +179,10 @@ func TestBaseNotifier(t *testing.T) {
|
|||||||
base := NewNotifierBase(model)
|
base := NewNotifierBase(model)
|
||||||
So(base.UploadImage, ShouldBeTrue)
|
So(base.UploadImage, ShouldBeTrue)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Convey("default value should be false for backwards compatibility", func() {
|
||||||
|
base := NewNotifierBase(model)
|
||||||
|
So(base.DisableResolvedMessage, ShouldBeFalse)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -259,10 +259,10 @@ func TestAlertNotificationSQLAccess(t *testing.T) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
Convey("Can search using an array of ids", func() {
|
Convey("Can search using an array of ids", func() {
|
||||||
cmd1 := models.CreateAlertNotificationCommand{Name: "nagios", Type: "webhook", OrgId: 1, SendReminder: true, DisableResolvedMessage: false, Frequency: "10s", Settings: simplejson.New()}
|
cmd1 := m.CreateAlertNotificationCommand{Name: "nagios", Type: "webhook", OrgId: 1, SendReminder: true, Frequency: "10s", Settings: simplejson.New()}
|
||||||
cmd2 := models.CreateAlertNotificationCommand{Name: "slack", Type: "webhook", OrgId: 1, SendReminder: true, DisableResolvedMessage: false, Frequency: "10s", Settings: simplejson.New()}
|
cmd2 := m.CreateAlertNotificationCommand{Name: "slack", Type: "webhook", OrgId: 1, SendReminder: true, Frequency: "10s", Settings: simplejson.New()}
|
||||||
cmd3 := models.CreateAlertNotificationCommand{Name: "ops2", Type: "email", OrgId: 1, SendReminder: true, DisableResolvedMessage: false, Frequency: "10s", Settings: simplejson.New()}
|
cmd3 := m.CreateAlertNotificationCommand{Name: "ops2", Type: "email", OrgId: 1, SendReminder: true, Frequency: "10s", Settings: simplejson.New()}
|
||||||
cmd4 := models.CreateAlertNotificationCommand{IsDefault: true, Name: "default", Type: "email", OrgId: 1, SendReminder: true, DisableResolvedMessage: false, Frequency: "10s", Settings: simplejson.New()}
|
cmd4 := m.CreateAlertNotificationCommand{IsDefault: true, Name: "default", Type: "email", OrgId: 1, SendReminder: true, Frequency: "10s", Settings: simplejson.New()}
|
||||||
|
|
||||||
otherOrg := models.CreateAlertNotificationCommand{Name: "default", Type: "email", OrgId: 2, SendReminder: true, DisableResolvedMessage: false, Frequency: "10s", Settings: simplejson.New()}
|
otherOrg := models.CreateAlertNotificationCommand{Name: "default", Type: "email", OrgId: 2, SendReminder: true, DisableResolvedMessage: false, Frequency: "10s", Settings: simplejson.New()}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ func addAlertMigrations(mg *Migrator) {
|
|||||||
Name: "send_reminder", Type: DB_Bool, Nullable: true, Default: "0",
|
Name: "send_reminder", Type: DB_Bool, Nullable: true, Default: "0",
|
||||||
}))
|
}))
|
||||||
mg.AddMigration("Add column disable_resolved_message", NewAddColumnMigration(alert_notification, &Column{
|
mg.AddMigration("Add column disable_resolved_message", NewAddColumnMigration(alert_notification, &Column{
|
||||||
Name: "disable_resolved_message", Type: DB_Bool, Nullable: false, Default: "1",
|
Name: "disable_resolved_message", Type: DB_Bool, Nullable: false, Default: "0",
|
||||||
}))
|
}))
|
||||||
|
|
||||||
mg.AddMigration("add index alert_notification org_id & name", NewAddIndexMigration(alert_notification, alert_notification.Indices[0]))
|
mg.AddMigration("add index alert_notification org_id & name", NewAddIndexMigration(alert_notification, alert_notification.Indices[0]))
|
||||||
|
Loading…
Reference in New Issue
Block a user