diff --git a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/CommonEqlRestTestCase.java b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/CommonEqlRestTestCase.java index a00f361b0a505..4c404fb5a0b15 100644 --- a/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/CommonEqlRestTestCase.java +++ b/x-pack/plugin/eql/qa/common/src/main/java/org/elasticsearch/test/eql/CommonEqlRestTestCase.java @@ -6,6 +6,7 @@ package org.elasticsearch.test.eql; import org.apache.http.util.EntityUtils; +import org.elasticsearch.Build; import org.elasticsearch.client.Request; import org.elasticsearch.client.Response; import org.elasticsearch.client.ResponseException; @@ -13,6 +14,7 @@ import org.elasticsearch.test.rest.ESRestTestCase; import org.junit.After; import org.junit.Before; +import org.junit.BeforeClass; import java.util.ArrayList; @@ -62,6 +64,11 @@ static class SearchTestConfiguration { 400, "query malformed, empty clause found")); } + @BeforeClass + public static void checkForSnapshot() { + assumeTrue("Only works on snapshot builds for now", Build.CURRENT.isSnapshot()); + } + @Before public void setup() throws Exception { createIndex(defaultValidationIndexName, Settings.EMPTY); diff --git a/x-pack/plugin/eql/qa/rest/build.gradle b/x-pack/plugin/eql/qa/rest/build.gradle index f73c719efad98..8e4f9dc97e1fa 100644 --- a/x-pack/plugin/eql/qa/rest/build.gradle +++ b/x-pack/plugin/eql/qa/rest/build.gradle @@ -1,3 +1,5 @@ +import org.elasticsearch.gradle.info.BuildParams + apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' @@ -9,7 +11,9 @@ dependencies { testClusters.integTest { testDistribution = 'DEFAULT' - setting 'xpack.eql.enabled', 'true' + if (BuildParams.isSnapshotBuild()) { + setting 'xpack.eql.enabled', 'true' + } setting 'xpack.license.self_generated.type', 'basic' setting 'xpack.monitoring.collection.enabled', 'true' } diff --git a/x-pack/plugin/eql/qa/rest/src/test/java/org/elasticsearch/xpack/eql/EqlRestIT.java b/x-pack/plugin/eql/qa/rest/src/test/java/org/elasticsearch/xpack/eql/EqlRestIT.java index 5ff7f23c51e48..aa1df16c58553 100644 --- a/x-pack/plugin/eql/qa/rest/src/test/java/org/elasticsearch/xpack/eql/EqlRestIT.java +++ b/x-pack/plugin/eql/qa/rest/src/test/java/org/elasticsearch/xpack/eql/EqlRestIT.java @@ -7,11 +7,18 @@ package org.elasticsearch.xpack.eql; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.Build; import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate; import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase; +import org.junit.BeforeClass; public class EqlRestIT extends ESClientYamlSuiteTestCase { + @BeforeClass + public static void checkForSnapshot() { + assumeTrue("Only works on snapshot builds for now", Build.CURRENT.isSnapshot()); + } + public EqlRestIT(final ClientYamlTestCandidate testCandidate) { super(testCandidate); }