Skip to content

Commit

Permalink
Add code comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand committed Nov 3, 2022
1 parent f0a3bdd commit 82942fa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
14 changes: 10 additions & 4 deletions doctest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 82942fa

Please sign in to comment.