Skip to content

Commit

Permalink
Add capabilities check for rest test
Browse files Browse the repository at this point in the history
  • Loading branch information
smalyshev committed Dec 27, 2024
1 parent 0ac116e commit ef59b3d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,11 @@ public void testIndexPattern() throws Exception {

@SuppressWarnings("unchecked")
public void testStats() throws IOException {
assumeTrue("Older versions do not have ESQL stats", Clusters.localClusterVersion().onOrAfter(Version.V_8_18_0));
Request caps = new Request("GET", "_capabilities?method=GET&path=_cluster/stats&capabilities=esql-stats");
Response capsResponse = client().performRequest(caps);
Map<String, Object> capsResult = entityAsMap(capsResponse.getEntity());
assumeTrue("esql stats capability missing", capsResult.get("supported").equals(true));

run("FROM test-local-index,*:test-remote-index | STATS total = SUM(data) BY color | SORT color", includeCCSMetadata());
Request stats = new Request("GET", "_cluster/stats");
Response statsResponse = client().performRequest(stats);
Expand Down

0 comments on commit ef59b3d

Please sign in to comment.