Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to run tests against unreleased OpenSearch #50

Merged
merged 2 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions .ci/run-opensearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ END
local_detach="true"
if [[ "$i" == "$((NUMBER_OF_NODES-1))" ]]; then local_detach=$DETACH; fi

echo -e "\033[34;1mINFO: building $CLUSTER container\033[0m"
echo 'cluster is' $CLUSTER
docker build \
--file=.ci/$CLUSTER/Dockerfile \
--build-arg SECURE_INTEGRATION=$SECURE_INTEGRATION \
--build-arg STACK_VERSION=$STACK_VERSION \
--tag=$CLUSTER-secure-$SECURE_INTEGRATION \
.
CLUSTER_TAG=$CLUSTER
if [[ "$STACK_VERSION" != *"SNAPSHOT" ]]; then
CLUSTER_TAG=$CLUSTER-secure-$SECURE_INTEGRATION
echo -e "\033[34;1mINFO: building $CLUSTER container\033[0m"
echo 'cluster is' $CLUSTER
docker build \
--file=.ci/$CLUSTER/Dockerfile \
--build-arg SECURE_INTEGRATION=$SECURE_INTEGRATION \
--build-arg STACK_VERSION=$STACK_VERSION \
--tag=$CLUSTER_TAG \
.
else
CLUSTER_TAG=$CLUSTER_TAG:test
fi

echo -e "\033[34;1mINFO:\033[0m Starting container $node_name \033[0m"
set -x
Expand All @@ -87,7 +93,7 @@ END
--health-timeout=2s \
--rm \
-d \
$CLUSTER-secure-$SECURE_INTEGRATION;
$CLUSTER_TAG;

set +x
if wait_for_container "$opensearch_node_name" "$network_name"; then
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/test-integrations-unreleased.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Integration with Unreleased OpenSearch

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
entry:
- { opensearch_ref: '1.x' }
- { opensearch_ref: '2.0' }
- { opensearch_ref: '2.x' }
- { opensearch_ref: 'main' }
steps:
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: opensearch-project/opensearch
ref: ${{ matrix.entry.opensearch_ref }}
path: opensearch

# This step builds the docker image tagged as opensearch:test. It will be further used in /ci/run-tests to test against unreleased OpenSearch.
# Reference: https://github.com/opensearch-project/OpenSearch/blob/2.0/distribution/docker/build.gradle#L190
- name: Assemble OpenSearch
run: |
cd opensearch
./gradlew assemble

- name: Checkout Rust Client
uses: actions/checkout@v2

- name: Increase system limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy

- name: Integ OpenSearch ${{ matrix.entry.opensearch_ref }} secured=false
run: "./.ci/run-tests opensearch SNAPSHOT false"