Alerting: Generate random id when testing notification channel (#31844)

This commit is contained in:
Lê Đặng Hoài Nam 2021-03-10 17:24:31 +07:00 committed by GitHub
parent 04e9f6c24f
commit 7764739a8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ package alerting
import (
"context"
"fmt"
"math/rand"
"net/http"
"github.com/grafana/grafana/pkg/components/securejsondata"
@ -82,6 +83,7 @@ func createTestEvalContext(cmd *NotificationTestCommand) *EvalContext {
Name: "Test notification",
Message: "Someone is testing the alert notification within Grafana.",
State: models.AlertStateAlerting,
ID: rand.Int63(),
}
ctx := NewEvalContext(context.Background(), testRule, fakeRequestValidator{})