Files
opensearch-pyd/.ci/run-tests
T
Daniel (dB.) Doubrovkine e022932ed1 Add the ability to run test patterns. (#454)
Signed-off-by: dblock <dblock@amazon.com>
2023-07-26 10:18:45 -07:00

43 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Entrypoint to run integration tests
# Default environment variables
export TEST_SUITE="${TEST_SUITE:=oss}"
export PYTHON_VERSION="${PYTHON_VERSION:=3.9}"
export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=Urllib3HttpConnection}"
export CLUSTER="${CLUSTER:-opensearch}"
export SECURE_INTEGRATION="${1:-false}"
export OPENSEARCH_VERSION="${2:-latest}"
export TEST_PATTERN="${3:-}"
if [[ "$SECURE_INTEGRATION" == "true" ]]; then
export OPENSEARCH_URL_EXTENSION="https"
else
export OPENSEARCH_URL_EXTENSION="http"
fi
export IS_UNRELEASED=false
if [[ "$OPENSEARCH_VERSION" == *"SNAPSHOT" ]]; then
IS_UNRELEASED=true
fi
echo -e "\033[1m>>>>> Unreleased is $IS_UNRELEASED >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
script_path=$(dirname $(realpath $0))
source $script_path/functions/imports.sh
set -euo pipefail
echo -e "\033[1m>>>>> Start server container >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
DETACH=true bash .ci/run-opensearch.sh
if [[ -n "$RUNSCRIPTS" ]]; then
for RUNSCRIPT in ${RUNSCRIPTS//,/ } ; do
echo -e "\033[1m>>>>> Running run-$RUNSCRIPT.sh >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
CONTAINER_NAME=${RUNSCRIPT} \
DETACH=true \
bash .ci/run-${RUNSCRIPT}.sh
done
fi
echo -e "\033[1m>>>>> Repository specific tests >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
bash .ci/run-repository.sh