forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EQL: Add integration tests harness to test EQL feature parity with or…
…iginal implementation (elastic#52248) The tests use the original test queries from https://github.com/endgameinc/eql/blob/master/eql/etc/test_queries.toml for EQL implementation correctness validation. The file test_queries_unsupported.toml serves as a "blacklist" for the queries that we do not support. Currently all of the queries are blacklisted. Over the time the expectation is to eventually have an empty "blacklist" when all of the queries are fully supported. The tests use the original test vector from https://raw.githubusercontent.com/endgameinc/eql/master/eql/etc/test_data.json. Only one EQL and the response is stubbed for now to match the expected output from that query. This part would need some tweaking after EQL is fully wired. Related to elastic#49581
- Loading branch information
Showing
17 changed files
with
5,175 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
.../plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequestBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.eql.action; | ||
|
||
import org.elasticsearch.action.ActionRequestBuilder; | ||
import org.elasticsearch.client.ElasticsearchClient; | ||
import org.elasticsearch.index.query.QueryBuilder; | ||
|
||
public class EqlSearchRequestBuilder extends ActionRequestBuilder<EqlSearchRequest, EqlSearchResponse> { | ||
public EqlSearchRequestBuilder(ElasticsearchClient client, EqlSearchAction action) { | ||
super(client, action, new EqlSearchRequest()); | ||
} | ||
|
||
public EqlSearchRequestBuilder indices(String... indices) { | ||
request.indices(indices); | ||
return this; | ||
} | ||
|
||
public EqlSearchRequestBuilder query(QueryBuilder query) { | ||
request.query(query); | ||
return this; | ||
} | ||
|
||
public EqlSearchRequestBuilder timestampField(String timestampField) { | ||
request.timestampField(timestampField); | ||
return this; | ||
} | ||
|
||
public EqlSearchRequestBuilder eventTypeField(String eventTypeField) { | ||
request.eventTypeField(eventTypeField); | ||
return this; | ||
} | ||
|
||
public EqlSearchRequestBuilder implicitJoinKeyField(String implicitJoinKeyField) { | ||
request.implicitJoinKeyField(implicitJoinKeyField); | ||
return this; | ||
} | ||
|
||
public EqlSearchRequestBuilder fetchSize(int size) { | ||
request.fetchSize(size); | ||
return this; | ||
} | ||
|
||
public EqlSearchRequestBuilder searchAfter(Object[] values) { | ||
request.searchAfter(values); | ||
return this; | ||
} | ||
|
||
public EqlSearchRequestBuilder rule(String rule) { | ||
request.rule(rule); | ||
return this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.