Skip to content

Commit

Permalink
Add support to run tests against unreleased OpenSearch (#50)
Browse files Browse the repository at this point in the history
* Add support to run tests against unreleased OpenSearch

Signed-off-by: Vacha Shah <[email protected]>

* Run workflow on all branches

Signed-off-by: Vacha Shah <[email protected]>
  • Loading branch information
VachaShah authored May 25, 2022
1 parent 1f1dda6 commit 13da93f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 9 deletions.
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"

0 comments on commit 13da93f

Please sign in to comment.