summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorgy95 <guoyao17@huawei.com>2022-09-06 11:27:09 +0800
committergy95 <guoyao17@huawei.com>2022-09-06 16:52:56 +0800
commit863830172432328a393840846e486924707c54a4 (patch)
tree4b817f5a4f28181cb64889a91d872f97a76e6330 /tests
parentMerge pull request #4150 from Shelley-BaoYue/master-metalog (diff)
downloadkubeedge-863830172432328a393840846e486924707c54a4.tar.gz
fix e2e failure not report
Signed-off-by: gy95 <guoyao17@huawei.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/e2e/scripts/execute.sh21
-rwxr-xr-xtests/e2e/scripts/fast_test.sh16
-rwxr-xr-xtests/e2e/scripts/keadm_deprecated_e2e.sh23
-rwxr-xr-xtests/e2e/scripts/keadm_e2e.sh17
4 files changed, 20 insertions, 57 deletions
diff --git a/tests/e2e/scripts/execute.sh b/tests/e2e/scripts/execute.sh
index ac6703ea2..077a9ae21 100755
--- a/tests/e2e/scripts/execute.sh
+++ b/tests/e2e/scripts/execute.sh
@@ -66,25 +66,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 47014e614..89f3748cf 100755
--- a/tests/e2e/scripts/fast_test.sh
+++ b/tests/e2e/scripts/fast_test.sh
@@ -36,14 +36,22 @@ then
--image-url=nginx \
--kube-master="https://$MASTER_IP:6443" \
--kubeconfig=$KUBECONFIG \
- --test.v \
- 2>&1 | tee -a /tmp/testcase.log
+ --test.v
+ GINKGO_TESTING_RESULT=$?
else
ginkgo -v ./$compilemodule/$compilemodule.test -- \
--image-url=nginx \
--image-url=nginx \
--kube-master="https://$MASTER_IP:6443" \
--kubeconfig=$KUBECONFIG \
- --test.v \
- 2>&1 | tee -a /tmp/testcase.log
+ --test.v
+ GINKGO_TESTING_RESULT=$?
+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/keadm_deprecated_e2e.sh b/tests/e2e/scripts/keadm_deprecated_e2e.sh
index 087fe323a..8517a6839 100755
--- a/tests/e2e/scripts/keadm_deprecated_e2e.sh
+++ b/tests/e2e/scripts/keadm_deprecated_e2e.sh
@@ -87,25 +87,10 @@ function run_test() {
--image-url=nginx \
--kube-master="https://$MASTER_IP:6443" \
--kubeconfig=$KUBECONFIG \
- --test.v \
- 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 !!"
+ --test.v
+ 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 df462375a..ac26d4927 100755
--- a/tests/e2e/scripts/keadm_e2e.sh
+++ b/tests/e2e/scripts/keadm_e2e.sh
@@ -90,21 +90,8 @@ function run_test() {
--image-url=nginx \
--kube-master="https://$MASTER_IP:6443" \
--kubeconfig=$KUBECONFIG \
- --test.v \
- 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
+ --test.v
+ if [[ $? != 0 ]]; then
echo "Integration suite has failures, Please check !!"
exit 1
else