mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(alerting): use uid and not rand() in tests for title (#85001)
This commit is contained in:
parent
a2facbecd4
commit
f2c7023fe6
@ -44,6 +44,7 @@ func config(t *testing.T) *setting.UnifiedAlertingSettings {
|
||||
|
||||
func validRule() apimodels.PostableExtendedRuleNode {
|
||||
forDuration := model.Duration(rand.Int63n(1000))
|
||||
uid := util.GenerateShortUID()
|
||||
return apimodels.PostableExtendedRuleNode{
|
||||
ApiRuleNode: &apimodels.ApiRuleNode{
|
||||
For: &forDuration,
|
||||
@ -55,7 +56,7 @@ func validRule() apimodels.PostableExtendedRuleNode {
|
||||
},
|
||||
},
|
||||
GrafanaManagedAlert: &apimodels.PostableGrafanaRule{
|
||||
Title: fmt.Sprintf("TEST-ALERT-%d", rand.Int63()),
|
||||
Title: fmt.Sprintf("TEST-ALERT-%s", uid),
|
||||
Condition: "A",
|
||||
Data: []apimodels.AlertQuery{
|
||||
{
|
||||
@ -69,7 +70,7 @@ func validRule() apimodels.PostableExtendedRuleNode {
|
||||
Model: nil,
|
||||
},
|
||||
},
|
||||
UID: util.GenerateShortUID(),
|
||||
UID: uid,
|
||||
NoDataState: allNoData[rand.Intn(len(allNoData))],
|
||||
ExecErrState: allExecError[rand.Intn(len(allExecError))],
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user