From 416859c0a0d119d56ec31240ce7d4298d217ba40 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Wed, 5 Aug 2020 19:30:45 +0800 Subject: [PATCH] update coverage test script. --- tests/perftest-scripts/coverage_test.sh | 26 ++++++++++++------- .../tdinternal_coverage_test.sh | 17 ++++++++---- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/tests/perftest-scripts/coverage_test.sh b/tests/perftest-scripts/coverage_test.sh index 152e20756b..6644cc62a3 100755 --- a/tests/perftest-scripts/coverage_test.sh +++ b/tests/perftest-scripts/coverage_test.sh @@ -32,7 +32,14 @@ function buildTDengine { echo "repo need to pull" git reset --hard git pull + fi + [ -d $TDENGINE_DIR/debug ] || mkdir $TDENGINE_DIR/debug + cd $TDENGINE_DIR/debug + [ -f $TDENGINE_DIR/debug/build/bin/taosd ] || need_rebuild=true + + if $need_rebuild ; then + echo "rebuild.." LOCAL_COMMIT=`git rev-parse --short @` rm -rf * @@ -46,10 +53,9 @@ function buildTDengine { function runGeneralCaseOneByOne { while read -r line; do if [[ $line =~ ^./test.sh* ]]; then - general_case=`echo $line | grep -w general` + case=`echo $line | grep -w "general\|unique\/mnode\/mgmt33.sim\|unique\/stable\/dnode3.sim\|unique\/cluster\/balance3.sim\|unique\/arbitrator\/offline_replica2_alterTable_online.sim"|awk '{print $NF}'` - if [ -n "$general_case" ]; then - case=`echo $line |grep general| awk '{print $NF}'` + if [ -n "$case" ]; then ./test.sh -f $case > /dev/null 2>&1 && \ echo -e "${GREEN}$case success${NC}" | tee -a $TDENGINE_COVERAGE_REPORT || \ echo -e "${RED}$case failed${NC}" | tee -a $TDENGINE_COVERAGE_REPORT @@ -90,14 +96,14 @@ function runTest { sleep 10 cd $TDENGINE_DIR/src/connector/jdbc - mvn clean package - mvn test | tee -a $TDENGINE_COVERAGE_REPORT + mvn clean package > /dev/null 2>&1 + mvn test > /dev/null 2>&1 | tee -a $TDENGINE_COVERAGE_REPORT # Test C Demo stopTaosd $TDENGINE_DIR/debug/build/bin/taosd -c $TDENGINE_DIR/debug/test/cfg > /dev/null & sleep 10 - yes | $TDENGINE_DIR/debug/build/bin/demo 127.0.0.1 | tee -a $TDENGINE_COVERAGE_REPORT + yes | $TDENGINE_DIR/debug/build/bin/demo 127.0.0.1 > /dev/null 2>&1 | tee -a $TDENGINE_COVERAGE_REPORT # Test waltest dataDir=`grep dataDir $TDENGINE_DIR/debug/test/cfg/taos.cfg|awk '{print $2}'` @@ -105,14 +111,14 @@ function runTest { echo "dataDir: $dataDir" | tee -a $TDENGINE_COVERAGE_REPORT echo "walDir: $walDir" | tee -a $TDENGINE_COVERAGE_REPORT if [ -n "$walDir" ]; then - yes | $TDENGINE_DIR/debug/build/bin/waltest -p $walDir | tee -a $TDENGINE_COVERAGE_REPORT + yes | $TDENGINE_DIR/debug/build/bin/waltest -p $walDir > dev/null 2>&1 | tee -a $TDENGINE_COVERAGE_REPORT fi # run Unit Test echo "Run Unit Test: utilTest, queryTest and cliTest" - $TDENGINE_DIR/debug/build/bin/utilTest > /dev/null && echo "utilTest pass!" || echo "utilTest failed!" - $TDENGINE_DIR/debug/build/bin/queryTest > /dev/null && echo "queryTest pass!" || echo "queryTest failed!" - $TDENGINE_DIR/debug/build/bin/cliTest > /dev/null && echo "cliTest pass!" || echo "cliTest failed!" + $TDENGINE_DIR/debug/build/bin/utilTest > /dev/null 2>&1 && echo "utilTest pass!" || echo "utilTest failed!" + $TDENGINE_DIR/debug/build/bin/queryTest > /dev/null 2>&1 && echo "queryTest pass!" || echo "queryTest failed!" + $TDENGINE_DIR/debug/build/bin/cliTest > /dev/null 2>&1 && echo "cliTest pass!" || echo "cliTest failed!" stopTaosd } diff --git a/tests/perftest-scripts/tdinternal_coverage_test.sh b/tests/perftest-scripts/tdinternal_coverage_test.sh index 91d204baf9..654c06cd0b 100755 --- a/tests/perftest-scripts/tdinternal_coverage_test.sh +++ b/tests/perftest-scripts/tdinternal_coverage_test.sh @@ -100,23 +100,30 @@ function runTest { sleep 10 cd $TDINTERNAL_DIR/community/src/connector/jdbc - mvn clean package - mvn test | tee -a $TDINTERNAL_COVERAGE_REPORT + mvn clean package > /dev/null + mvn test > /dev/null | tee -a $TDINTERNAL_COVERAGE_REPORT # Test C Demo stopTaosd $TDINTERNAL_DIR/debug/build/bin/taosd -c $TDINTERNAL_DIR/debug/test/cfg > /dev/null & sleep 10 - yes | $TDINTERNAL_DIR/debug/build/bin/demo 127.0.0.1 | tee -a $TDINTERNAL_COVERAGE_REPORT + yes | $TDINTERNAL_DIR/debug/build/bin/demo 127.0.0.1 > /dev/null | tee -a $TDINTERNAL_COVERAGE_REPORT # Test waltest dataDir=`grep dataDir $TDINTERNAL_DIR/debug/test/cfg/taos.cfg|awk '{print $2}'` walDir=`find $dataDir -name "wal"|head -n1` - echo "dataDir: $dataDir\nwalDir: $walDir" | tee -a $TDINTERNAL_COVERAGE_REPORT + echo "dataDir: $dataDir" | tee -a $TDINTERNAL_COVERAGE_REPORT + echo "walDir: $walDir" | tee -a $TDINTERNAL_COVERAGE_REPORT if [ -n "$walDir" ]; then - yes | $TDINTERNAL_DIR/debug/build/bin/waltest -p $walDir | tee -a $TDINTERNAL_COVERAGE_REPORT + yes | $TDINTERNAL_DIR/debug/build/bin/waltest -p $walDir > /dev/null | tee -a $TDINTERNAL_COVERAGE_REPORT fi + # run Unit Test + echo "Run Unit Test: utilTest, queryTest and cliTest" + $TDINTERNAL_DIR/debug/build/bin/utilTest > /dev/null 2>&1 && echo "utilTest pass!" || echo "utilTest failed!" + $TDINTERNAL_DIR/debug/build/bin/queryTest > /dev/null 2>&1 && echo "queryTest pass!" || echo "queryTest failed!" + $TDINTERNAL_DIR/debug/build/bin/cliTest > /dev/null 2>&1 && echo "cliTest pass!" || echo "cliTest failed!" + stopTaosd } -- GitLab