tech(alerting): change queryrange to int from str

This commit is contained in:
bergquist
2016-05-30 09:18:22 +02:00
parent 51511dd654
commit 16a9e56eca
9 changed files with 12 additions and 11 deletions
@@ -33,7 +33,7 @@ func TestAlertRuleChangesDataAccess(t *testing.T) {
Interval: "10",
Title: "Alerting title",
Description: "Alerting description",
QueryRange: "5m",
QueryRange: 3600,
Aggregator: "avg",
OrgId: FakeOrgId,
},
+3 -3
View File
@@ -28,7 +28,7 @@ func TestAlertingDataAccess(t *testing.T) {
Interval: "10",
Title: "Alerting title",
Description: "Alerting description",
QueryRange: "5m",
QueryRange: 3600,
Aggregator: "avg",
DatasourceId: 42,
},
@@ -67,7 +67,7 @@ func TestAlertingDataAccess(t *testing.T) {
So(alert.QueryRefId, ShouldEqual, "A")
So(alert.Title, ShouldEqual, "Alerting title")
So(alert.Description, ShouldEqual, "Alerting description")
So(alert.QueryRange, ShouldEqual, "5m")
So(alert.QueryRange, ShouldEqual, 3600)
So(alert.Aggregator, ShouldEqual, "avg")
So(alert.State, ShouldEqual, "OK")
So(alert.DatasourceId, ShouldEqual, 42)
@@ -191,7 +191,7 @@ func TestAlertingDataAccess(t *testing.T) {
Interval: "10",
Title: "Alerting title",
Description: "Alerting description",
QueryRange: "5m",
QueryRange: 3600,
Aggregator: "avg",
},
}
+1 -1
View File
@@ -27,7 +27,7 @@ func TestAlertingStateAccess(t *testing.T) {
Interval: "10",
Title: "Alerting title",
Description: "Alerting description",
QueryRange: "5m",
QueryRange: 3600,
Aggregator: "avg",
},
}
@@ -24,7 +24,7 @@ func addAlertMigrations(mg *Migrator) {
{Name: "frequency", Type: DB_BigInt, Nullable: false},
{Name: "title", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "description", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "query_range", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "query_range", Type: DB_Int, Nullable: false},
{Name: "aggregator", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "state", Type: DB_NVarchar, Length: 255, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},