Skip to content

Commit 190862b

Browse files
committed
test(integ-test): add verifyDataRows to dashboard patterns IT
Per @dai-chen: schema-only verification doesn't catch "query succeeds but returns 0/wrong rows". Pin the 4 BRAIN clusters with their exact patterns, counts, and sample logs against the HDFS_LOGS fixture. Signed-off-by: Kai Huang <ahkcs@amazon.com>
1 parent 26b2d69 commit 190862b

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLDashboardPatternsIT.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
package org.opensearch.sql.calcite.remote;
77

88
import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_HDFS_LOGS;
9+
import static org.opensearch.sql.util.MatcherUtils.rows;
910
import static org.opensearch.sql.util.MatcherUtils.schema;
11+
import static org.opensearch.sql.util.MatcherUtils.verifyDataRows;
1012
import static org.opensearch.sql.util.MatcherUtils.verifySchemaInOrder;
1113

14+
import com.google.common.collect.ImmutableList;
1215
import java.io.IOException;
1316
import org.json.JSONObject;
1417
import org.junit.Test;
@@ -42,5 +45,30 @@ public void testDashboardBrainLabelStatsByPatternsField() throws IOException {
4245
schema("patterns_field", "string"),
4346
schema("pattern_count", "bigint"),
4447
schema("sample_logs", "array"));
48+
verifyDataRows(
49+
result,
50+
rows(
51+
"BLOCK* NameSystem.addStoredBlock: blockMap updated: <*IP*> is added to blk_<*> size"
52+
+ " <*>",
53+
2,
54+
ImmutableList.of(
55+
"BLOCK* NameSystem.addStoredBlock: blockMap updated: 10.251.31.85:50010 is added"
56+
+ " to blk_-7017553867379051457 size 67108864")),
57+
rows(
58+
"PacketResponder failed <*> blk_<*>",
59+
2,
60+
ImmutableList.of("PacketResponder failed for blk_6996194389878584395")),
61+
rows(
62+
"Verification succeeded <*> blk_<*>",
63+
2,
64+
ImmutableList.of("Verification succeeded for blk_-1547954353065580372")),
65+
rows(
66+
"<*> NameSystem.allocateBlock:"
67+
+ " /user/root/sortrand/_temporary/_task_<*>_<*>_r_<*>_<*>/part<*> blk_<*>",
68+
2,
69+
ImmutableList.of(
70+
"BLOCK* NameSystem.allocateBlock:"
71+
+ " /user/root/sortrand/_temporary/_task_200811092030_0002_r_000296_0/part-00296."
72+
+ " blk_-6620182933895093708")));
4573
}
4674
}

0 commit comments

Comments
 (0)