Skip to content

Commit

Permalink
Fix settings name in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Siddhant Deshmukh <deshsid@amazon.com>
  • Loading branch information
deshsidd committed Sep 4, 2024
1 parent 33726b6 commit 8c23d8e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ protected String defaultTopQueryGroupingSettings() {
+ " \"search.insights.top_queries.latency.window_size\" : \"1m\",\n"
+ " \"search.insights.top_queries.latency.top_n_size\" : 5,\n"
+ " \"search.insights.top_queries.group_by\" : \"similarity\",\n"
+ " \"search.insights.top_queries.max_groups\" : 5\n"
+ " \"search.insights.top_queries.max_groups_excluding_topn\" : 5\n"
+ " }\n"
+ "}";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private String groupByNoneSettings() {
+ " \"search.insights.top_queries.latency.window_size\" : \"1m\",\n"
+ " \"search.insights.top_queries.latency.top_n_size\" : 100,\n"
+ " \"search.insights.top_queries.group_by\" : \"none\",\n"
+ " \"search.insights.top_queries.max_groups\" : 5\n"
+ " \"search.insights.top_queries.max_groups_excluding_topn\" : 5\n"
+ " }\n"
+ "}";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,19 @@ public void testValidQueryGroupingSettings() throws IOException {

private String[] invalidQueryGroupingSettings() {
return new String[] {
// Invalid max_groups: below minimum (0)
"{\n" + " \"persistent\" : {\n" + " \"search.insights.top_queries.max_groups\" : 0\n" + " }\n" + "}",
// Invalid max_groups: below minimum (-1)
"{\n"
+ " \"persistent\" : {\n"
+ " \"search.insights.top_queries.max_groups_excluding_topn\" : -1\n"
+ " }\n"
+ "}",

// Invalid max_groups: above maximum (10001)
"{\n" + " \"persistent\" : {\n" + " \"search.insights.top_queries.max_groups\" : 10001\n" + " }\n" + "}",
"{\n"
+ " \"persistent\" : {\n"
+ " \"search.insights.top_queries.max_groups_excluding_topn\" : 10001\n"
+ " }\n"
+ "}",

// Invalid group_by: unsupported value
"{\n"
Expand All @@ -112,11 +120,19 @@ private String[] invalidQueryGroupingSettings() {

private String[] validQueryGroupingSettings() {
return new String[] {
// Valid max_groups: minimum value (1)
"{\n" + " \"persistent\" : {\n" + " \"search.insights.top_queries.max_groups\" : 1\n" + " }\n" + "}",
// Valid max_groups: minimum value (0)
"{\n"
+ " \"persistent\" : {\n"
+ " \"search.insights.top_queries.max_groups_excluding_topn\" : 0\n"
+ " }\n"
+ "}",

// Valid max_groups: maximum value (10000)
"{\n" + " \"persistent\" : {\n" + " \"search.insights.top_queries.max_groups\" : 10000\n" + " }\n" + "}",
"{\n"
+ " \"persistent\" : {\n"
+ " \"search.insights.top_queries.max_groups_excluding_topn\" : 10000\n"
+ " }\n"
+ "}",

// Valid group_by: supported value (SIMILARITY)
"{\n" + " \"persistent\" : {\n" + " \"search.insights.top_queries.group_by\" : \"SIMILARITY\"\n" + " }\n" + "}" };
Expand All @@ -129,7 +145,7 @@ private String groupByNoneSettings() {
+ " \"search.insights.top_queries.latency.window_size\" : \"1m\",\n"
+ " \"search.insights.top_queries.latency.top_n_size\" : 100,\n"
+ " \"search.insights.top_queries.group_by\" : \"none\",\n"
+ " \"search.insights.top_queries.max_groups\" : 5\n"
+ " \"search.insights.top_queries.max_groups_excluding_topn\" : 5\n"
+ " }\n"
+ "}";
}
Expand Down

0 comments on commit 8c23d8e

Please sign in to comment.