Skip to content

Commit

Permalink
Add passing OPENSEARCH_JAVA_OPTS into the docker container used for t…
Browse files Browse the repository at this point in the history
…ests

Signed-off-by: Neetika Singhal <[email protected]>
  • Loading branch information
neetikasinghal committed Jul 31, 2024
1 parent 83343b2 commit ec085d3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/opensearch-cluster/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 28 additions & 1 deletion .github/workflows/test-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ec085d3

Please sign in to comment.