Skip to content

Commit 795b477

Browse files
committed
remove index patterns from tests
Signed-off-by: Surya Sashank Nistala <[email protected]>
1 parent cb2236a commit 795b477

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
907907
}"""
908908

909909
val docQuery = DocLevelQuery(query = "test_field:\"us-west-2\"", name = testQueryName, fields = listOf())
910-
val docLevelInput = DocLevelMonitorInput("description", listOf("$testIndexPrefix*"), listOf(docQuery))
910+
val docLevelInput = DocLevelMonitorInput("description", listOf("${testIndexPrefix}1", "${testIndexPrefix}2"), listOf(docQuery))
911911

912912
val trigger = randomDocumentLevelTrigger(condition = Script("query[name=$testQueryName]"))
913913
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -951,7 +951,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
951951
}"""
952952

953953
val docQuery = DocLevelQuery(query = "test_field:\"us-west-2\"", name = testQueryName, fields = listOf())
954-
val docLevelInput = DocLevelMonitorInput("description", listOf("$testIndexPrefix*"), listOf(docQuery))
954+
val docLevelInput = DocLevelMonitorInput("description", listOf("${testIndexPrefix}1", "${testIndexPrefix}2"), listOf(docQuery))
955955

956956
val trigger = randomDocumentLevelTrigger(condition = Script("query[name=$testQueryName]"))
957957
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -999,7 +999,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
999999
}"""
10001000

10011001
val docQuery = DocLevelQuery(query = "NOT (test_field:\"us-west-1\")", name = testQueryName, fields = listOf())
1002-
val docLevelInput = DocLevelMonitorInput("description", listOf("$testIndexPrefix*"), listOf(docQuery))
1002+
val docLevelInput = DocLevelMonitorInput("description", listOf("${testIndexPrefix}1", "${testIndexPrefix}2"), listOf(docQuery))
10031003

10041004
val trigger = randomDocumentLevelTrigger(condition = Script("query[name=$testQueryName]"))
10051005
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -1040,7 +1040,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
10401040
}"""
10411041

10421042
val docQuery = DocLevelQuery(query = "test_field:\"us-west-2\"", name = "3", fields = listOf())
1043-
val docLevelInput = DocLevelMonitorInput("description", listOf("test*"), listOf(docQuery))
1043+
val docLevelInput = DocLevelMonitorInput("description", listOf("test1", "test2"), listOf(docQuery))
10441044

10451045
val trigger = randomDocumentLevelTrigger(condition = ALWAYS_RUN)
10461046
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -1132,7 +1132,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
11321132
name = "5",
11331133
fields = listOf()
11341134
)
1135-
val docLevelInput = DocLevelMonitorInput("description", listOf("test*"), listOf(docQuery1, docQuery2))
1135+
val docLevelInput = DocLevelMonitorInput("description", listOf("test1"), listOf(docQuery1, docQuery2))
11361136

11371137
val trigger = randomDocumentLevelTrigger(condition = ALWAYS_RUN)
11381138
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -1265,7 +1265,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
12651265
name = "5",
12661266
fields = listOf()
12671267
)
1268-
val docLevelInput = DocLevelMonitorInput("description", listOf("test*"), listOf(docQuery))
1268+
val docLevelInput = DocLevelMonitorInput("description", listOf("test1", "test2"), listOf(docQuery))
12691269

12701270
val trigger = randomDocumentLevelTrigger(condition = ALWAYS_RUN)
12711271
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -1352,7 +1352,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
13521352
name = "5",
13531353
fields = listOf()
13541354
)
1355-
val docLevelInput = DocLevelMonitorInput("description", listOf("test*"), listOf(docQuery))
1355+
val docLevelInput = DocLevelMonitorInput("description", listOf("test1", "test2"), listOf(docQuery))
13561356

13571357
val trigger = randomDocumentLevelTrigger(condition = ALWAYS_RUN)
13581358
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -1475,7 +1475,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
14751475
fields = listOf()
14761476
)
14771477

1478-
val docLevelInput = DocLevelMonitorInput("description", listOf("test*"), listOf(docQuery1, docQuery2))
1478+
val docLevelInput = DocLevelMonitorInput("description", listOf("test1", "test2", "test4"), listOf(docQuery1, docQuery2))
14791479

14801480
val trigger = randomDocumentLevelTrigger(condition = ALWAYS_RUN)
14811481
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -1520,7 +1520,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
15201520
}"""
15211521

15221522
val docQuery = DocLevelQuery(query = "test_field:\"us-west-2\"", name = "3", fields = listOf())
1523-
val docLevelInput = DocLevelMonitorInput("description", listOf("test*"), listOf(docQuery))
1523+
val docLevelInput = DocLevelMonitorInput("description", listOf("test1"), listOf(docQuery))
15241524

15251525
val trigger = randomDocumentLevelTrigger(condition = ALWAYS_RUN)
15261526
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -1570,7 +1570,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
15701570

15711571
val docQuery1 = DocLevelQuery(query = "test_field:\"us-west-2\"", name = "3", fields = listOf())
15721572
val docQuery2 = DocLevelQuery(query = "test_field_new:\"us-west-2\"", name = "4", fields = listOf())
1573-
val docLevelInput = DocLevelMonitorInput("description", listOf("test*"), listOf(docQuery1, docQuery2))
1573+
val docLevelInput = DocLevelMonitorInput("description", listOf("test1", "test2"), listOf(docQuery1, docQuery2))
15741574

15751575
val trigger = randomDocumentLevelTrigger(condition = ALWAYS_RUN)
15761576
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -2025,7 +2025,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
20252025
indexDoc(dataStreamName2, "0", testDoc)
20262026

20272027
val docQuery = DocLevelQuery(query = "test_field:\"us-west-2\"", name = "3", fields = listOf())
2028-
val docLevelInput = DocLevelMonitorInput("description", listOf("test-datastream*"), listOf(docQuery))
2028+
val docLevelInput = DocLevelMonitorInput("description", listOf("test-datastream1", "test-datastream2"), listOf(docQuery))
20292029

20302030
val action = randomAction(template = randomTemplateScript("Hello {{ctx.monitor.name}}"), destinationId = createDestination().id)
20312031
val monitor = createMonitor(
@@ -2327,7 +2327,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
23272327

23282328
val query = "NOT test_field:\"us-west-1\" AND _exists_: test_field"
23292329
val docQuery = DocLevelQuery(query = query, name = testQueryName, fields = listOf())
2330-
val docLevelInput = DocLevelMonitorInput("description", listOf("$testIndexPrefix*"), listOf(docQuery))
2330+
val docLevelInput = DocLevelMonitorInput("description", listOf("${testIndexPrefix}1,${testIndexPrefix}2"), listOf(docQuery))
23312331

23322332
val trigger = randomDocumentLevelTrigger(condition = Script("query[name=$testQueryName]"))
23332333
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -2439,7 +2439,8 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
24392439
fields = listOf()
24402440
)
24412441

2442-
val docLevelInput = DocLevelMonitorInput("description", listOf("test*"), listOf(docQuery1, docQuery2))
2442+
val docLevelInput =
2443+
DocLevelMonitorInput("description", listOf("$testIndex", "$testIndex2", "$testIndex4"), listOf(docQuery1, docQuery2))
24432444

24442445
val trigger = randomDocumentLevelTrigger(condition = ALWAYS_RUN)
24452446
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))
@@ -2521,7 +2522,7 @@ class DocumentMonitorRunnerIT : AlertingRestTestCase() {
25212522
name = "5",
25222523
fields = listOf()
25232524
)
2524-
val docLevelInput = DocLevelMonitorInput("description", listOf("test*"), listOf(docQuery))
2525+
val docLevelInput = DocLevelMonitorInput("description", listOf("test1", "test2"), listOf(docQuery))
25252526

25262527
val trigger = randomDocumentLevelTrigger(condition = ALWAYS_RUN)
25272528
val monitor = createMonitor(randomDocumentLevelMonitor(inputs = listOf(docLevelInput), triggers = listOf(trigger)))

0 commit comments

Comments
 (0)