diff --git a/doctest/build.gradle b/doctest/build.gradle index 0ea402592d..93307f405e 100644 --- a/doctest/build.gradle +++ b/doctest/build.gradle @@ -88,12 +88,18 @@ task stopPrometheus() { } stopPrometheus.mustRunAfter startPrometheus +doctest.dependsOn startOpenSearch +doctest.finalizedBy stopOpenSearch + +// OpenSearch designed to run on Linux only in production, so main CI workflows are on Linux too. +// As of #977 gradle workflows which depend on Prometheus use hardcoded Linux version of it. +// Auxiliary workflows and developers who use other OS should be able to run tests as well, +// so this trick unblocks them to run doctests. Note: Prometheus related tests would fail. if (DefaultNativePlatform.currentOperatingSystem.isLinux()) { - doctest.dependsOn startOpenSearch - doctest.finalizedBy stopOpenSearch + startOpenSearch.dependsOn startPrometheus + stopOpenSearch.finalizedBy stopPrometheus } -startOpenSearch.dependsOn startPrometheus -stopOpenSearch.finalizedBy stopPrometheus + build.dependsOn doctest clean.dependsOn(cleanBootstrap) diff --git a/integ-test/build.gradle b/integ-test/build.gradle index 86fe215456..b8c6789e01 100644 --- a/integ-test/build.gradle +++ b/integ-test/build.gradle @@ -137,6 +137,10 @@ stopPrometheus.mustRunAfter startPrometheus integTest { dependsOn ':opensearch-sql-plugin:bundlePlugin' + // OpenSearch designed to run on Linux only in production, so main CI workflows are on Linux too. + // As of #977 gradle workflows which depend on Prometheus use hardcoded Linux version of it. + // Auxiliary workflows and developers who use other OS should be able to run tests as well, + // so this trick unblocks them to run ITs. Note: Prometheus related tests would be skipped. if (DefaultNativePlatform.currentOperatingSystem.isLinux()) { dependsOn startPrometheus finalizedBy stopPrometheus diff --git a/integ-test/src/test/java/org/opensearch/sql/ppl/ShowCatalogsCommandIT.java b/integ-test/src/test/java/org/opensearch/sql/ppl/ShowCatalogsCommandIT.java index cf75cf892f..927e93a01f 100644 --- a/integ-test/src/test/java/org/opensearch/sql/ppl/ShowCatalogsCommandIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/ppl/ShowCatalogsCommandIT.java @@ -21,6 +21,12 @@ public class ShowCatalogsCommandIT extends PPLIntegTestCase { + /** + * OpenSearch designed to run on Linux only in production, so main CI workflows are on Linux too. + * As of #977 gradle workflows which depend on Prometheus use hardcoded Linux version of it. + * Auxiliary workflows and developers who use other OS should be able to run tests as well, + * so this trick skips Prometheus related tests to avoid failures. + */ @BeforeClass public static void checkOs() { Assume.assumeTrue(SystemUtils.IS_OS_LINUX);