mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'alerting_definitions' of github.com:grafana/grafana into alerting_definitions
This commit is contained in:
commit
a66027830b
@ -15,7 +15,7 @@ func TestAlertingDataAccess(t *testing.T) {
|
|||||||
testDash := insertTestDashboard("dashboard with alerts", 1, "alert")
|
testDash := insertTestDashboard("dashboard with alerts", 1, "alert")
|
||||||
|
|
||||||
items := []*m.AlertRule{
|
items := []*m.AlertRule{
|
||||||
&m.AlertRule{
|
{
|
||||||
PanelId: 1,
|
PanelId: 1,
|
||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
OrgId: testDash.OrgId,
|
OrgId: testDash.OrgId,
|
||||||
@ -117,19 +117,19 @@ func TestAlertingDataAccess(t *testing.T) {
|
|||||||
|
|
||||||
Convey("Multiple alerts per dashboard", func() {
|
Convey("Multiple alerts per dashboard", func() {
|
||||||
multipleItems := []*m.AlertRule{
|
multipleItems := []*m.AlertRule{
|
||||||
&m.AlertRule{
|
{
|
||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
PanelId: 1,
|
PanelId: 1,
|
||||||
Query: "1",
|
Query: "1",
|
||||||
OrgId: 1,
|
OrgId: 1,
|
||||||
},
|
},
|
||||||
&m.AlertRule{
|
{
|
||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
PanelId: 2,
|
PanelId: 2,
|
||||||
Query: "2",
|
Query: "2",
|
||||||
OrgId: 1,
|
OrgId: 1,
|
||||||
},
|
},
|
||||||
&m.AlertRule{
|
{
|
||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
PanelId: 3,
|
PanelId: 3,
|
||||||
Query: "3",
|
Query: "3",
|
||||||
@ -179,7 +179,7 @@ func TestAlertingDataAccess(t *testing.T) {
|
|||||||
|
|
||||||
Convey("When dashboard is removed", func() {
|
Convey("When dashboard is removed", func() {
|
||||||
items := []*m.AlertRule{
|
items := []*m.AlertRule{
|
||||||
&m.AlertRule{
|
{
|
||||||
PanelId: 1,
|
PanelId: 1,
|
||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
Query: "Query",
|
Query: "Query",
|
||||||
|
@ -14,7 +14,7 @@ func TestAlertingStateAccess(t *testing.T) {
|
|||||||
testDash := insertTestDashboard("dashboard with alerts", 1, "alert")
|
testDash := insertTestDashboard("dashboard with alerts", 1, "alert")
|
||||||
|
|
||||||
items := []*m.AlertRule{
|
items := []*m.AlertRule{
|
||||||
&m.AlertRule{
|
{
|
||||||
PanelId: 1,
|
PanelId: 1,
|
||||||
DashboardId: testDash.Id,
|
DashboardId: testDash.Id,
|
||||||
OrgId: testDash.OrgId,
|
OrgId: testDash.OrgId,
|
||||||
|
@ -108,7 +108,7 @@ func TestAlertModel(t *testing.T) {
|
|||||||
"warnOperator": ">",
|
"warnOperator": ">",
|
||||||
"critOperator": ">",
|
"critOperator": ">",
|
||||||
"aggregator": "sum",
|
"aggregator": "sum",
|
||||||
"queryRange": "10m",
|
"queryRange": 3600,
|
||||||
"frequency": 10,
|
"frequency": 10,
|
||||||
"name": "active desktop users",
|
"name": "active desktop users",
|
||||||
"description": "restart webservers"
|
"description": "restart webservers"
|
||||||
@ -195,9 +195,9 @@ func TestAlertModel(t *testing.T) {
|
|||||||
"warnLevel": 300,
|
"warnLevel": 300,
|
||||||
"critLevel": 500,
|
"critLevel": 500,
|
||||||
"aggregator": "avg",
|
"aggregator": "avg",
|
||||||
"queryRange": "10m",
|
"queryRange": 3600,
|
||||||
"frequency": 10,
|
"frequency": 10,
|
||||||
"title": "active mobile users",
|
"name": "active mobile users",
|
||||||
"description": "restart itunes"
|
"description": "restart itunes"
|
||||||
},
|
},
|
||||||
"links": []
|
"links": []
|
||||||
@ -385,7 +385,8 @@ func TestAlertModel(t *testing.T) {
|
|||||||
So(v.Aggregator, ShouldNotBeEmpty)
|
So(v.Aggregator, ShouldNotBeEmpty)
|
||||||
So(v.Query, ShouldNotBeEmpty)
|
So(v.Query, ShouldNotBeEmpty)
|
||||||
So(v.QueryRefId, ShouldNotBeEmpty)
|
So(v.QueryRefId, ShouldNotBeEmpty)
|
||||||
So(v.QueryRange, ShouldNotBeEmpty)
|
So(v.QueryRange, ShouldNotEqual, 0)
|
||||||
|
So(v.Frequency, ShouldNotEqual, 0)
|
||||||
So(v.Name, ShouldNotBeEmpty)
|
So(v.Name, ShouldNotBeEmpty)
|
||||||
So(v.Description, ShouldNotBeEmpty)
|
So(v.Description, ShouldNotBeEmpty)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user