mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
feat(alerting): fixed build issues
This commit is contained in:
parent
3af891d023
commit
8c30babdf1
@ -44,7 +44,6 @@ func TestAlertRuleExtraction(t *testing.T) {
|
||||
"handler": 1,
|
||||
"enabled": true,
|
||||
"frequency": "60s",
|
||||
"severity": "critical",
|
||||
"conditions": [
|
||||
{
|
||||
"type": "query",
|
||||
@ -129,11 +128,6 @@ func TestAlertRuleExtraction(t *testing.T) {
|
||||
So(alerts[1].Handler, ShouldEqual, 0)
|
||||
})
|
||||
|
||||
Convey("should extract Severity property", func() {
|
||||
So(alerts[0].Severity, ShouldEqual, "critical")
|
||||
So(alerts[1].Severity, ShouldEqual, "warning")
|
||||
})
|
||||
|
||||
Convey("should extract frequency in seconds", func() {
|
||||
So(alerts[0].Frequency, ShouldEqual, 60)
|
||||
So(alerts[1].Frequency, ShouldEqual, 60)
|
||||
|
@ -1,12 +1,8 @@
|
||||
package notifiers
|
||||
|
||||
import (
|
||||
"testing"
|
||||
import . "github.com/smartystreets/goconvey/convey"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
func TestBaseNotifier(t *testing.T) {
|
||||
func TestBaseNotifier( /* t *testing.T */ ) {
|
||||
// Convey("Parsing base notification state", t, func() {
|
||||
//
|
||||
// Convey("matches", func() {
|
||||
|
@ -40,6 +40,7 @@ type Item struct {
|
||||
OrgId int64 `json:"orgId"`
|
||||
DashboardId int64 `json:"dashboardId"`
|
||||
PanelId int64 `json:"panelId"`
|
||||
CategoryId int64 `json:"panelId"`
|
||||
Type ItemType `json:"type"`
|
||||
Title string `json:"title"`
|
||||
Text string `json:"text"`
|
||||
|
@ -15,6 +15,7 @@ func addAnnotationMig(mg *Migrator) {
|
||||
{Name: "user_id", Type: DB_BigInt, Nullable: true},
|
||||
{Name: "dashboard_id", Type: DB_BigInt, Nullable: true},
|
||||
{Name: "panel_id", Type: DB_BigInt, Nullable: true},
|
||||
{Name: "category_id", Type: DB_BigInt, Nullable: true},
|
||||
{Name: "type", Type: DB_NVarchar, Length: 25, Nullable: false},
|
||||
{Name: "title", Type: DB_Text, Nullable: false},
|
||||
{Name: "text", Type: DB_Text, Nullable: false},
|
||||
@ -27,18 +28,20 @@ func addAnnotationMig(mg *Migrator) {
|
||||
Indices: []*Index{
|
||||
{Cols: []string{"org_id", "alert_id"}, Type: IndexType},
|
||||
{Cols: []string{"org_id", "type"}, Type: IndexType},
|
||||
{Cols: []string{"dashboard_id", "panel_id"}, Type: IndexType},
|
||||
{Cols: []string{"epoch"}, Type: IndexType},
|
||||
{Cols: []string{"org_id", "category_id"}, Type: IndexType},
|
||||
{Cols: []string{"org_id", "dashboard_id", "panel_id", "epoch"}, Type: IndexType},
|
||||
{Cols: []string{"org_id", "epoch"}, Type: IndexType},
|
||||
},
|
||||
}
|
||||
|
||||
mg.AddMigration("Drop old annotation table v3", NewDropTableMigration("annotation"))
|
||||
mg.AddMigration("Drop old annotation table v4", NewDropTableMigration("annotation"))
|
||||
|
||||
mg.AddMigration("create annotation table v4", NewAddTableMigration(table))
|
||||
mg.AddMigration("create annotation table v5", NewAddTableMigration(table))
|
||||
|
||||
// create indices
|
||||
mg.AddMigration("add index annotation org_id & alert_id v3", NewAddIndexMigration(table, table.Indices[0]))
|
||||
mg.AddMigration("add index annotation org_id & type v3", NewAddIndexMigration(table, table.Indices[1]))
|
||||
mg.AddMigration("add index annotation dashboard_id panel_id", NewAddIndexMigration(table, table.Indices[2]))
|
||||
mg.AddMigration("add index annotation epoch v3", NewAddIndexMigration(table, table.Indices[3]))
|
||||
mg.AddMigration("add index annotation 0 v3", NewAddIndexMigration(table, table.Indices[0]))
|
||||
mg.AddMigration("add index annotation 1 v3", NewAddIndexMigration(table, table.Indices[1]))
|
||||
mg.AddMigration("add index annotation 2 v3", NewAddIndexMigration(table, table.Indices[2]))
|
||||
mg.AddMigration("add index annotation 3 v3", NewAddIndexMigration(table, table.Indices[3]))
|
||||
mg.AddMigration("add index annotation 4 v3", NewAddIndexMigration(table, table.Indices[4]))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user