summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgy95 <guoyao17@huawei.com>2022-09-06 11:27:09 +0800
committergy95 <guoyao17@huawei.com>2022-09-21 11:03:58 +0800
commit51f3d656c4b58e8725eaf4b6c677f01b7cfbb697 (patch)
tree141c3a3cd0a49bc5171e83f944c49a911040718f
parentfix keadm_deprecated_e2e error (diff)
downloadkubeedge-51f3d656c4b58e8725eaf4b6c677f01b7cfbb697.tar.gz
fix e2e failure not report
Signed-off-by: gy95 <guoyao17@huawei.com>
-rwxr-xr-xedge/test/integration/scripts/execute.sh17
-rwxr-xr-xedge/test/integration/scripts/fast_test.sh28
-rwxr-xr-xtests/e2e/scripts/execute.sh21
-rwxr-xr-xtests/e2e/scripts/fast_test.sh17
-rwxr-xr-xtests/e2e/scripts/helm_keadm_e2e.sh23
-rwxr-xr-xtests/e2e/scripts/keadm_e2e.sh29
6 files changed, 45 insertions, 90 deletions
diff --git a/edge/test/integration/scripts/execute.sh b/edge/test/integration/scripts/execute.sh
index 186e6f697..60af398e6 100755
--- a/edge/test/integration/scripts/execute.sh
+++ b/edge/test/integration/scripts/execute.sh
@@ -47,23 +47,6 @@ function run_test() {
local module=$1
MQTT_SERVER=127.0.0.1 bash -x ${TEST_DIR}/scripts/fast_test.sh $module
-
- grep -e "Running Suite" -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | sed -r 's/\x1B\[([0-9];)?([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g' | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g'
- echo "Integration Test Final Summary Report"
- echo "==============================================="
- echo "Total Number of Test cases = `grep "Ran " /tmp/testcase.log | awk '{sum+=$2} END {print sum}'`"
- passed=`grep -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | awk '{print $3}' | sed -r "s/\x1B\[([0-9];)?([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{sum+=$1} END {print sum}'`
- echo "Number of Test cases PASSED = $passed"
- fail=`grep -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | awk '{print $6}' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{sum+=$1} END {print sum}'`
- echo "Number of Test cases FAILED = $fail"
- echo "==================Result Summary======================="
- if [ "$fail" != "0" ];then
- echo "Integration suite has failures, Please check !!"
- exit 1
- else
- echo "Integration suite successfully passed all the tests !!"
- exit 0
- fi
}
set -eE
diff --git a/edge/test/integration/scripts/fast_test.sh b/edge/test/integration/scripts/fast_test.sh
index 2de3e0090..1af5b0555 100755
--- a/edge/test/integration/scripts/fast_test.sh
+++ b/edge/test/integration/scripts/fast_test.sh
@@ -34,13 +34,33 @@ cat >config.json<<END
}
END
+GINKGO_EXIT_CODE=0
if [[ $# -eq 0 ]]; then
#run testcase
export KUBEEDGE_ROOT=$KUBEEDGE_ROOT
- ./appdeployment/appdeployment.test $debugflag 2>&1 | tee -a /tmp/testcase.log
- ./device/device.test $debugflag 2>&1 | tee -a /tmp/testcase.log
- ./metaserver/metaserver.test $debugflag 2>&1 | tee -a /tmp/testcase.log
+ ./appdeployment/appdeployment.test $debugflag
+ if [[ $? != 0 ]]; then
+ GINKGO_EXIT_CODE=1
+ fi
+ ./device/device.test $debugflag
+ if [[ $? != 0 ]]; then
+ GINKGO_EXIT_CODE=1
+ fi
+ ./metaserver/metaserver.test $debugflag
+ if [[ $? != 0 ]]; then
+ GINKGO_EXIT_CODE=1
+ fi
else
- ./$compilemodule/$compilemodule.test $debugflag $runtest 2>&1 | tee -a /tmp/testcase.log
+ ./$compilemodule/$compilemodule.test $debugflag $runtest
+ if [[ $? != 0 ]]; then
+ GINKGO_EXIT_CODE=1
+ fi
fi
+if [[ $GINKGO_EXIT_CODE != 0 ]]; then
+ echo "Integration suite has failures, Please check !!"
+ exit 1
+else
+ echo "Integration suite successfully passed all the tests !!"
+ exit 0
+fi
diff --git a/tests/e2e/scripts/execute.sh b/tests/e2e/scripts/execute.sh
index 1938ab66d..4c848767e 100755
--- a/tests/e2e/scripts/execute.sh
+++ b/tests/e2e/scripts/execute.sh
@@ -49,25 +49,8 @@ kubectl create clusterrolebinding system:anonymous --clusterrole=cluster-admin -
:> /tmp/testcase.log
-bash -x ${E2E_DIR}/scripts/fast_test.sh $1
-
-#stop the edgecore after the test completion
-grep -e "Running Suite" -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | sed -r 's/\x1B\[([0-9];)?([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g' | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g'
-echo "Integration Test Final Summary Report"
-echo "==============================================="
-echo "Total Number of Test cases = `grep "Ran " /tmp/testcase.log | awk '{sum+=$2} END {print sum}'`"
-passed=`grep -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | awk '{print $3}' | sed -r "s/\x1B\[([0-9];)?([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{sum+=$1} END {print sum}'`
-echo "Number of Test cases PASSED = $passed"
-fail=`grep -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | awk '{print $6}' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{sum+=$1} END {print sum}'`
-echo "Number of Test cases FAILED = $fail"
-echo "==================Result Summary======================="
+export GINKGO_TESTING_RESULT=0
trap cleanup EXIT
-if [ "$fail" != "0" ];then
- echo "Integration suite has failures, Please check !!"
- exit 1
-else
- echo "Integration suite successfully passed all the tests !!"
- exit 0
-fi
+bash -x ${E2E_DIR}/scripts/fast_test.sh $1
diff --git a/tests/e2e/scripts/fast_test.sh b/tests/e2e/scripts/fast_test.sh
index e5ed49216..76dd7d35d 100755
--- a/tests/e2e/scripts/fast_test.sh
+++ b/tests/e2e/scripts/fast_test.sh
@@ -46,14 +46,25 @@ END
if [ $# -eq 0 ]
then
#run testcase
- ./deployment/deployment.test $debugflag 2>&1 | tee -a /tmp/testcase.log
+ ./deployment/deployment.test $debugflag
+ GINKGO_TESTING_RESULT=$?
# @kadisi
#./edgesite/edgesite.test $debugflag 2>&1 | tee -a /tmp/testcase.log
else
if [[ $compilemodule = "bluetooth" ]]
then
- ./mapper/bluetooth/bluetooth.test $debugflag $runtest 2>&1 | tee -a /tmp/testcase.log
+ ./mapper/bluetooth/bluetooth.test $debugflag $runtest
+ GINKGO_TESTING_RESULT=$?
else
- ./$compilemodule/$compilemodule.test $debugflag $runtest 2>&1 | tee -a /tmp/testcase.log
+ ./$compilemodule/$compilemodule.test $debugflag $runtest
+ GINKGO_TESTING_RESULT=$?
fi
fi
+
+if [[ $GINKGO_TESTING_RESULT != 0 ]]; then
+ echo "Integration suite has failures, Please check !!"
+ exit 1
+else
+ echo "Integration suite successfully passed all the tests !!"
+ exit 0
+fi
diff --git a/tests/e2e/scripts/helm_keadm_e2e.sh b/tests/e2e/scripts/helm_keadm_e2e.sh
index d3bcb1747..ecf423dba 100755
--- a/tests/e2e/scripts/helm_keadm_e2e.sh
+++ b/tests/e2e/scripts/helm_keadm_e2e.sh
@@ -95,25 +95,10 @@ END
function run_test() {
:> /tmp/testcase.log
cd $E2E_DIR
- ./keadm/keadm.test $debugflag 2>&1 | tee -a /tmp/testcase.log
-
- #stop the edgecore after the test completion
- grep -e "Running Suite" -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | sed -r 's/\x1B\[([0-9];)?([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g' | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g'
- echo "Integration Test Final Summary Report"
- echo "======================================================="
- echo "Total Number of Test cases = `grep "Ran " /tmp/testcase.log | awk '{sum+=$2} END {print sum}'`"
- passed=`grep -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | awk '{print $3}' | sed -r "s/\x1B\[([0-9];)?([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{sum+=$1} END {print sum}'`
- echo "Number of Test cases PASSED = $passed"
- fail=`grep -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | awk '{print $6}' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{sum+=$1} END {print sum}'`
- echo "Number of Test cases FAILED = $fail"
- echo "==================Result Summary======================="
-
- if [ "$fail" != "0" ];then
- echo "Integration suite has failures, Please check !!"
- exit 1
- else
- echo "Integration suite successfully passed all the tests !!"
- exit 0
+ ./keadm/keadm.test $debugflag 2>&1
+ if [[ $? != 0 ]]; then
+ echo "Integration suite has failures, Please check !!"
+ exit 1
fi
}
diff --git a/tests/e2e/scripts/keadm_e2e.sh b/tests/e2e/scripts/keadm_e2e.sh
index eca36c7dd..89cf47ca7 100755
--- a/tests/e2e/scripts/keadm_e2e.sh
+++ b/tests/e2e/scripts/keadm_e2e.sh
@@ -95,33 +95,7 @@ END
function run_test() {
:> /tmp/testcase.log
cd $E2E_DIR
- ./keadm/keadm.test $debugflag 2>&1 | tee -a /tmp/testcase.log
-
- #stop the edgecore after the test completion
- grep -e "Running Suite" -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | sed -r 's/\x1B\[([0-9];)?([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g' | sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g'
- echo "Integration Test Final Summary Report"
- echo "======================================================="
- echo "Total Number of Test cases = `grep "Ran " /tmp/testcase.log | awk '{sum+=$2} END {print sum}'`"
- passed=`grep -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | awk '{print $3}' | sed -r "s/\x1B\[([0-9];)?([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{sum+=$1} END {print sum}'`
- echo "Number of Test cases PASSED = $passed"
- fail=`grep -e "SUCCESS\!" -e "FAIL\!" /tmp/testcase.log | awk '{print $6}' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | awk '{sum+=$1} END {print sum}'`
- echo "Number of Test cases FAILED = $fail"
- echo "==================Result Summary======================="
-
- if [ "$fail" != "0" ];then
- echo "Integration suite has failures, Please check !!"
- exit 1
- else
- echo "Integration suite successfully passed all the tests !!"
-
- export ACK_GINKGO_RC=true
-
- ginkgo -v ./keadm/keadm.test -- \
- --image-url=nginx \
- --image-url=nginx \
- --kube-master="https://$MASTER_IP:6443" \
- --kubeconfig=$KUBECONFIG \
- --test.v
+ ./keadm/keadm.test $debugflag
GINKGO_TESTING_RESULT=$?
if [[ $GINKGO_TESTING_RESULT != 0 ]]; then
@@ -140,7 +114,6 @@ function run_test() {
exit 1
else
echo "Integration suite successfully passed all the tests !!"
- exit 0
fi
}