From ec085d391d93aabb9e5566ac221fc94904e04f81 Mon Sep 17 00:00:00 2001 From: Neetika Singhal Date: Tue, 30 Jul 2024 15:43:27 -0700 Subject: [PATCH] Add passing OPENSEARCH_JAVA_OPTS into the docker container used for tests Signed-off-by: Neetika Singhal --- .github/opensearch-cluster/docker-compose.yml | 3 +- .github/workflows/test-spec.yml | 29 ++++++++++++++++++- CHANGELOG.md | 1 + 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/opensearch-cluster/docker-compose.yml b/.github/opensearch-cluster/docker-compose.yml index bdd6f2be9..8912dd9e3 100644 --- a/.github/opensearch-cluster/docker-compose.yml +++ b/.github/opensearch-cluster/docker-compose.yml @@ -8,6 +8,7 @@ services: - '9600:9600' environment: - 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!}' + - 'OPENSEARCH_JAVA_OPTS=${OPENSEARCH_JAVA_OPTS}' - discovery.type=single-node - path.repo=/tmp/opensearch/repo - - plugins.index_state_management.job_interval=1 + - plugins.index_state_management.job_interval=1 \ No newline at end of file diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index c147cbf40..70eafd56b 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -26,7 +26,11 @@ jobs: - {version: 1.3.17, admin_password: admin} - {version: 2.0.0, admin_password: admin} - {version: 2.15.0} - - {version: 2.16.0, hub: opensearchstaging, ref: '@sha256:50fbfe3b95c41e92a113ada3e80513ba4524dfc8a25dc6aaeff2bbe1e1145d5f'} + - version: 2.16.0 + hub: opensearchstaging + ref: '@sha256:50fbfe3b95c41e92a113ada3e80513ba4524dfc8a25dc6aaeff2bbe1e1145d5f' + features: + - tiered_remote_index: true name: test-opensearch-spec (version=${{ matrix.entry.version }}, hub=${{ matrix.entry.hub || 'opensearchproject' }}) runs-on: ubuntu-latest @@ -38,6 +42,29 @@ jobs: OPENSEARCH_PASSWORD: ${{ matrix.entry.admin_password || 'myStrongPassword123!' }} steps: + - name: Set OPENSEARCH_JAVA_OPTS + run: | + # Initialize options array + opts=() + prefix="-Dopensearch.experimental.feature" + suffix="enabled" + + # Extract features directly from the matrix + features="${{ matrix.entry.features }}" + + # Split features into key-value pairs + IFS=',' read -r -a feature_pairs <<< "$features" + + # Process each key-value pair + for pair in "${feature_pairs[@]}"; do + IFS='=' read -r key value <<< "$pair" + opts+=("${prefix}.${key}.${suffix}=${value}") + done + + # Set the environment variable + echo "OPENSEARCH_JAVA_OPTS=$(IFS=','; echo "${opts[*]}")" >> $GITHUB_ENV + echo $GITHUB_ENV + - name: Checkout Repo uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fb7e4bdf..293500bca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added test coverage ([#443](https://github.com/opensearch-project/opensearch-api-specification/pull/443)) - Added `--opensearch-version` to `merger` that excludes schema elements per semver ([#428](https://github.com/opensearch-project/opensearch-api-specification/pull/428)) - Added `retry` to `tester` to support asynchronous tasks ([453](https://github.com/opensearch-project/opensearch-api-specification/pull/453)) +- Added passing OPENSEARCH_JAVA_OPTS into the docker container used for tests ([#454](https://github.com/opensearch-project/opensearch-api-specification/pull/454)) ### Changed