Skip to content

Commit

Permalink
add optional parameter -o to integtest.sh (#644)
Browse files Browse the repository at this point in the history
Signed-off-by: Divya Madala <[email protected]>
(cherry picked from commit f265231)
  • Loading branch information
Divyaasm authored and github-actions[bot] committed Apr 27, 2023
1 parent 3a1b00f commit 05143de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions integtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

set -e

. ./test_finder.sh

function usage() {
echo ""
echo "This script is used to run integration tests for plugin installed on a remote OpenSearch/Dashboards cluster."
Expand All @@ -20,11 +18,12 @@ function usage() {
echo -e "-c CREDENTIAL\t(usename:password), no defaults, effective when SECURITY_ENABLED=true."
echo -e "-t TEST_COMPONENTS\t(OpenSearch-Dashboards reportsDashboards etc.), optional, specify test components, separate with space, else test everything."
echo -e "-v VERSION\t, no defaults, indicates the OpenSearch version to test."
echo -e "-o OPTION\t, no defaults, determine the TEST_TYPE value among(default, manifest) in test_finder.sh, optional."
echo -e "-h\tPrint this message."
echo "--------------------------------------------------------------------------"
}

while getopts ":hb:p:s:c:t:v:" arg; do
while getopts ":hb:p:s:c:t:v:o:" arg; do
case $arg in
h)
usage
Expand All @@ -48,6 +47,9 @@ while getopts ":hb:p:s:c:t:v:" arg; do
v)
VERSION=$OPTARG
;;
o)
OPTION=$OPTARG
;;
:)
echo "-${OPTARG} requires an argument"
usage
Expand Down Expand Up @@ -83,6 +85,8 @@ then
PASSWORD=`echo $CREDENTIAL | awk -F ':' '{print $2}'`
fi

. ./test_finder.sh

npm install

TEST_FILES=`get_test_list $TEST_COMPONENTS`
Expand Down
6 changes: 5 additions & 1 deletion test_finder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
OSD_BUILD_MANIFEST='../local-test-cluster/opensearch-dashboards-*/manifest.yml'
OSD_TEST_PATH='cypress/integration/core-opensearch-dashboards'
OSD_PLUGIN_TEST_PATH='cypress/integration/plugins'
TEST_TYPE=$OPTION

# Map component name in opensearch-build repo INPUT_MANIFEST with folder name for tests in functional repo
OSD_COMPONENT_TEST_MAP=( "OpenSearch-Dashboards:opensearch-dashboards"
Expand All @@ -24,7 +25,10 @@ OSD_COMPONENT_TEST_MAP=( "OpenSearch-Dashboards:opensearch-dashboards"
"securityAnalyticsDashboards:security-analytics-dashboards-plugin"
)

[ -f $OSD_BUILD_MANIFEST ] && TEST_TYPE="manifest" || TEST_TYPE="default"
if [ -z $TEST_TYPE ]; then
[ -f $OSD_BUILD_MANIFEST ] && TEST_TYPE="manifest" || TEST_TYPE="default"
fi

[ ! `echo $SHELL | grep 'bash'` ] && echo "You must run this script with bash as other shells like zsh will fail the script, exit in 10" && sleep 10 && exit 1

# Checks if build manifest in parent directory of current directory under local-test-cluster/opensearch-dashboards-*
Expand Down

0 comments on commit 05143de

Please sign in to comment.