Skip to content

Commit

Permalink
Merge pull request kubernetes-retired#478 from abhaikollara/e2e-test-…
Browse files Browse the repository at this point in the history
…improvements

Improvements in e2e_tests
  • Loading branch information
k8s-ci-robot authored Apr 6, 2023
2 parents ef0dc3d + 92349c2 commit fe3c972
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
22 changes: 12 additions & 10 deletions hack/test_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

source "${SCRIPT_DIR}"/utils.sh
source "${SCRIPT_DIR}"/common.sh
source "${SCRIPT_DIR}"/test_skip_list.sh

if [[ $OSTYPE == 'darwin'* ]]; then
info_message "The kpng build script only works on linux... Exiting now!"
exit 1
Expand All @@ -28,7 +35,6 @@ shopt -s expand_aliases
CONTAINER_ENGINE="docker"
KPNG_IMAGE_TAG_NAME="kpng:test"
KUBECONFIG_TESTS="kubeconfig_tests.conf"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# ginkgo
GINKGO_NUMBER_OF_NODES=25
Expand All @@ -39,10 +45,6 @@ GINKGO_DUMP_LOGS_ON_FAILURE=false
GINKGO_DISABLE_LOG_DUMP=true
GINKGO_PROVIDER="local"

source "${SCRIPT_DIR}"/utils.sh
source "${SCRIPT_DIR}"/common.sh
source "${SCRIPT_DIR}"/test_skip_list.sh

function if_error_warning {
###########################################################################
# Description: #
Expand All @@ -53,8 +55,8 @@ function if_error_warning {
###########################################################################
if [ "$?" != "0" ]; then
if [ -n "$1" ]; then
RED="\e[91m"
ENDCOLOR="\e[0m"
RED="\033[91m"
ENDCOLOR="\033[0m"
echo -e "[ ${RED}FAILED${ENDCOLOR} ] ${1}"
fi
fi
Expand All @@ -79,9 +81,9 @@ function result_message {
echo "result_message() requires a message"
exit 1
fi
RED="\e[91m"
GREEN="\e[92m"
ENDCOLOR="\e[0m"
RED="\033[91m"
GREEN="\033[92m"
ENDCOLOR="\033[0m"

if [ "${result}" == "0" ] ; then
echo -e "${GREEN}[SUCCESS!] ${message} succeded!!! ${ENDCOLOR}"
Expand Down
14 changes: 7 additions & 7 deletions hack/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function if_error_exit {
###########################################################################
if [ "$?" != "0" ]; then
if [ -n "$1" ]; then
RED="\e[91m"
ENDCOLOR="\e[0m"
RED="\033[91m"
ENDCOLOR="\033[0m"
echo -e "[ ${RED}FAILED${ENDCOLOR} ] ${1}"
fi
exit 1
Expand All @@ -44,8 +44,8 @@ function pass_message {
echo "pass_message() requires a message"
exit 1
fi
GREEN="\e[92m"
ENDCOLOR="\e[0m"
GREEN="\033[92m"
ENDCOLOR="\033[0m"
echo -e "[ ${GREEN}PASSED${ENDCOLOR} ] ${1}"
}

Expand All @@ -61,8 +61,8 @@ function info_message {
echo "info_message() requires a message"
exit 1
fi
BLUE="\e[94m"
ENDCOLOR="\e[0m"
BLUE="\033[94m"
ENDCOLOR="\033[0m"
echo -e "[ ${BLUE}INFO${ENDCOLOR} ] ${1}"
}

Expand Down Expand Up @@ -92,7 +92,7 @@ function add_to_path {
command_exists() {
###########################################################################
# Description: #
# Checkt if a binary exists #
# Checks if a binary exists #
# #
# Arguments: #
# arg1: binary name #
Expand Down

0 comments on commit fe3c972

Please sign in to comment.