diff --git a/integtest.sh b/integtest.sh index da15b02e9..b1bc8811c 100755 --- a/integtest.sh +++ b/integtest.sh @@ -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." @@ -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 @@ -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 @@ -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` diff --git a/test_finder.sh b/test_finder.sh index 50e0939b7..ee4314641 100755 --- a/test_finder.sh +++ b/test_finder.sh @@ -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" @@ -23,7 +24,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-*