diff --git a/integ-test/src/test/java/org/opensearch/sql/plugin/AnalyticsEngineCompatIT.java b/integ-test/src/test/java/org/opensearch/sql/plugin/AnalyticsEngineCompatIT.java index 5cd89fa7cd9..f6ec903c395 100644 --- a/integ-test/src/test/java/org/opensearch/sql/plugin/AnalyticsEngineCompatIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/plugin/AnalyticsEngineCompatIT.java @@ -5,17 +5,55 @@ package org.opensearch.sql.plugin; +import static org.junit.Assume.assumeTrue; + +import java.io.IOException; +import org.junit.Before; import org.junit.Test; -import org.opensearch.test.rest.OpenSearchRestTestCase; +import org.opensearch.client.Request; +import org.opensearch.client.Response; +import org.opensearch.sql.legacy.OpenSearchSQLRestTestCase; +import org.opensearch.sql.legacy.TestUtils; /** * Smoke test: verifies that opensearch-sql loads cleanly alongside arrow-flight-rpc and * analytics-engine. A successful cluster start is the only assertion — no sql-specific logic runs. + * + *

This test is only meaningful when the analytics-engine plugin is installed; the dedicated + * {@code :integ-test:analyticsEngineCompatIT} Gradle task bundles the plugin stack for exactly that + * purpose. Other lanes can still discover this class — notably the distribution integ-test + * pipeline, which scans every {@code *IT} class against the built distribution and may run with the + * security plugin enabled and without analytics-engine. A {@code build.gradle} exclude does not + * protect against that pipeline, so the test guards itself instead: + * + *

*/ -public class AnalyticsEngineCompatIT extends OpenSearchRestTestCase { +public class AnalyticsEngineCompatIT extends OpenSearchSQLRestTestCase { + + /** + * Skips the suite unless the analytics-engine plugin is installed. Runs after the framework has + * established the (security-aware) REST client, so the lookup itself succeeds on both plain and + * secured clusters. + */ + @Before + public void requireAnalyticsEngine() throws IOException { + Response response = client().performRequest(new Request("GET", "/_cat/plugins?h=component")); + String installedPlugins = TestUtils.getResponseBody(response, true); + assumeTrue( + "analytics-engine plugin not installed — skipping coexistence smoke test", + installedPlugins.contains("analytics-engine")); + } @Test public void testClusterStarted() { - // If the cluster booted, all three plugins loaded without classloader errors. + // If the cluster booted with analytics-engine present, all plugins loaded without classloader + // errors. The assumption above guarantees we only assert this where it is meaningful. } }