From ee319bca9fe51cb84aa0858a6c8fc05d55d8736f Mon Sep 17 00:00:00 2001 From: Neetika Singhal Date: Wed, 9 Aug 2023 10:03:33 -0700 Subject: [PATCH] add github workflows Signed-off-by: Neetika Singhal Set the concurrent search feature flag setting in the tests if the concurrent search feature is enabled Signed-off-by: Neetika Singhal (cherry picked from commit 5e39f321d5656587235b3c9fedd47b2cbff7195c) --- .github/workflows/concurrent-search.yml | 34 +++++++++++++++++++ .github/workflows/sync.yml | 20 +++++++++++ .../test/OpenSearchIntegTestCase.java | 3 ++ .../test/OpenSearchSingleNodeTestCase.java | 3 ++ 4 files changed, 60 insertions(+) create mode 100644 .github/workflows/concurrent-search.yml create mode 100644 .github/workflows/sync.yml diff --git a/.github/workflows/concurrent-search.yml b/.github/workflows/concurrent-search.yml new file mode 100644 index 0000000000000..b80f57a04fa8c --- /dev/null +++ b/.github/workflows/concurrent-search.yml @@ -0,0 +1,34 @@ +--- +name: Concurrent Search UTs and ITs + +on: + schedule: + - cron: '0 */13 * * *' # every 13 hours + workflow_dispatch: # on button click + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] # precommit on ubuntu-latest is run as a part of the gradle-check workflow + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + if: always() + uses: actions/setup-java@v2 + with: + java-version: 11 + distribution: adopt + - name: Build the repo + if: always() + run: | + ./gradlew assemble -x :distribution:docker:buildArm64DockerImage -x :distribution:docker:buildDockerImage -x :distribution:docker:buildPpc64leDockerImage -x :distribution:docker:docker-export:exportDockerImage -x :distribution:docker:buildS390xDockerImage -x :distribution:docker:docker-ppc64le-export:exportDockerImage -x :distribution:docker:docker-s390x-export:exportDockerImage + - name: Run Gradle unit tests + if: always() + run: | + ./gradlew test -Dopensearch.experimental.feature.concurrent_segment_search.enabled=true + - name: Run Gradle integration tests + if: always() + run: | + ./gradlew internalClusterTest --parallel -Dopensearch.experimental.feature.concurrent_segment_search.enabled=true diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 0000000000000..cad2b0c2c95cf --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,20 @@ +name: Sync Fork + +on: + schedule: + - cron: '0 */1 * * *' # every 1 hour + workflow_dispatch: # on button click + +jobs: + sync: + + runs-on: ubuntu-latest + + steps: + - uses: tgymnich/fork-sync@v1.8 + with: + token: ${{ secrets.PERSONAL_TOKEN }} + owner: neetikasinghal + base: main + head: main + merge_method: rebase diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java index 382152652cafe..37e3cb35afef6 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchIntegTestCase.java @@ -787,6 +787,9 @@ protected Settings featureFlagSettings() { } // Enabling Telemetry setting by default featureSettings.put(FeatureFlags.TELEMETRY_SETTING.getKey(), true); + if(FeatureFlags.isEnabled(FeatureFlags.CONCURRENT_SEGMENT_SEARCH)) { + featureSettings.put(FeatureFlags.CONCURRENT_SEGMENT_SEARCH, true); + } return featureSettings.build(); } diff --git a/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java b/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java index 2de4c8fdbdfb8..32a02535a9246 100644 --- a/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/OpenSearchSingleNodeTestCase.java @@ -436,6 +436,9 @@ protected Settings featureFlagSettings() { featureSettings.put(builtInFlag.getKey(), builtInFlag.getDefaultRaw(Settings.EMPTY)); } featureSettings.put(FeatureFlags.TELEMETRY_SETTING.getKey(), true); + if(FeatureFlags.isEnabled(FeatureFlags.CONCURRENT_SEGMENT_SEARCH)) { + featureSettings.put(FeatureFlags.CONCURRENT_SEGMENT_SEARCH, true); + } return featureSettings.build(); }