Alerting: introduce AlertQuery in definitions package (#63825)
* copy AlertQuery from ngmodels to the definition package * replaces usages of ngmodels.AlertQuery in API models * create a converter between models of AlertQuery --------- Co-authored-by: Alex Moreno <alexander.moreno@grafana.com>
This commit is contained in:
@@ -5,8 +5,6 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/ngalert/models"
|
||||
)
|
||||
|
||||
func TestRulePayloadMarshaling(t *testing.T) {
|
||||
@@ -24,7 +22,7 @@ func TestRulePayloadMarshaling(t *testing.T) {
|
||||
{
|
||||
desc: "success grafana",
|
||||
input: func() TestRulePayload {
|
||||
data := models.AlertQuery{}
|
||||
data := AlertQuery{}
|
||||
|
||||
// hack around that the struct embeds the json message inside of it as well
|
||||
raw, _ := json.Marshal(data)
|
||||
@@ -33,7 +31,7 @@ func TestRulePayloadMarshaling(t *testing.T) {
|
||||
return TestRulePayload{
|
||||
GrafanaManagedCondition: &EvalAlertConditionCommand{
|
||||
Condition: "placeholder",
|
||||
Data: []models.AlertQuery{data},
|
||||
Data: []AlertQuery{data},
|
||||
},
|
||||
}
|
||||
}(),
|
||||
|
||||
Reference in New Issue
Block a user