Skip to content

Commit ec085d3

Browse files
Add passing OPENSEARCH_JAVA_OPTS into the docker container used for tests
Signed-off-by: Neetika Singhal <[email protected]>
1 parent 83343b2 commit ec085d3

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

.github/opensearch-cluster/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
- '9600:9600'
99
environment:
1010
- 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!}'
11+
- 'OPENSEARCH_JAVA_OPTS=${OPENSEARCH_JAVA_OPTS}'
1112
- discovery.type=single-node
1213
- path.repo=/tmp/opensearch/repo
13-
- plugins.index_state_management.job_interval=1
14+
- plugins.index_state_management.job_interval=1

.github/workflows/test-spec.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ jobs:
2626
- {version: 1.3.17, admin_password: admin}
2727
- {version: 2.0.0, admin_password: admin}
2828
- {version: 2.15.0}
29-
- {version: 2.16.0, hub: opensearchstaging, ref: '@sha256:50fbfe3b95c41e92a113ada3e80513ba4524dfc8a25dc6aaeff2bbe1e1145d5f'}
29+
- version: 2.16.0
30+
hub: opensearchstaging
31+
ref: '@sha256:50fbfe3b95c41e92a113ada3e80513ba4524dfc8a25dc6aaeff2bbe1e1145d5f'
32+
features:
33+
- tiered_remote_index: true
3034

3135
name: test-opensearch-spec (version=${{ matrix.entry.version }}, hub=${{ matrix.entry.hub || 'opensearchproject' }})
3236
runs-on: ubuntu-latest
@@ -38,6 +42,29 @@ jobs:
3842
OPENSEARCH_PASSWORD: ${{ matrix.entry.admin_password || 'myStrongPassword123!' }}
3943

4044
steps:
45+
- name: Set OPENSEARCH_JAVA_OPTS
46+
run: |
47+
# Initialize options array
48+
opts=()
49+
prefix="-Dopensearch.experimental.feature"
50+
suffix="enabled"
51+
52+
# Extract features directly from the matrix
53+
features="${{ matrix.entry.features }}"
54+
55+
# Split features into key-value pairs
56+
IFS=',' read -r -a feature_pairs <<< "$features"
57+
58+
# Process each key-value pair
59+
for pair in "${feature_pairs[@]}"; do
60+
IFS='=' read -r key value <<< "$pair"
61+
opts+=("${prefix}.${key}.${suffix}=${value}")
62+
done
63+
64+
# Set the environment variable
65+
echo "OPENSEARCH_JAVA_OPTS=$(IFS=','; echo "${opts[*]}")" >> $GITHUB_ENV
66+
echo $GITHUB_ENV
67+
4168
- name: Checkout Repo
4269
uses: actions/checkout@v4
4370

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5656
- Added test coverage ([#443](https://github.com/opensearch-project/opensearch-api-specification/pull/443))
5757
- Added `--opensearch-version` to `merger` that excludes schema elements per semver ([#428](https://github.com/opensearch-project/opensearch-api-specification/pull/428))
5858
- Added `retry` to `tester` to support asynchronous tasks ([453](https://github.com/opensearch-project/opensearch-api-specification/pull/453))
59+
- Added passing OPENSEARCH_JAVA_OPTS into the docker container used for tests ([#454](https://github.com/opensearch-project/opensearch-api-specification/pull/454))
5960

6061
### Changed
6162

0 commit comments

Comments
 (0)