diff --git a/Jenkinsfile b/Jenkinsfile
index 7a3da2b3a0..976812bd0a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -225,6 +225,8 @@ pipeline {
./test-all.sh b4fq
cd ${WKC}/tests
./test-all.sh p4
+ cd ${WKC}/tests
+ ./test-all.sh full jdbc
date'''
}
}
diff --git a/src/connector/jdbc/pom.xml b/src/connector/jdbc/pom.xml
index 8ebf8aa5cc..f80441b4cb 100755
--- a/src/connector/jdbc/pom.xml
+++ b/src/connector/jdbc/pom.xml
@@ -132,6 +132,7 @@
**/TaosInfoMonitorTest.java
**/FailOverTest.java
**/InvalidResultSetPointerTest.java
+ **/RestfulConnectionTest.java
true
diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/rs/RestfulConnectionTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/rs/RestfulConnectionTest.java
index 68eccd876e..d1dfc0bcc4 100644
--- a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/rs/RestfulConnectionTest.java
+++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/rs/RestfulConnectionTest.java
@@ -15,8 +15,8 @@ import java.util.Properties;
public class RestfulConnectionTest {
- // private static final String host = "127.0.0.1";
- private static final String host = "master";
+ private static final String host = "127.0.0.1";
+ // private static final String host = "master";
private static Connection conn;
@Test
diff --git a/tests/Jenkinsfile b/tests/Jenkinsfile
index aa1815fc63..2f8b0de09d 100644
--- a/tests/Jenkinsfile
+++ b/tests/Jenkinsfile
@@ -55,6 +55,8 @@ pipeline {
sh '''
cd ${WKC}/tests
./test-all.sh b1
+ cd ${WKC}/tests
+ ./test-all.sh full jdbc
date'''
}
}
diff --git a/tests/test-all.sh b/tests/test-all.sh
index f03e3f88c3..3177da745f 100755
--- a/tests/test-all.sh
+++ b/tests/test-all.sh
@@ -7,6 +7,21 @@ GREEN_DARK='\033[0;32m'
GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m'
+tests_dir=`pwd`
+IN_TDINTERNAL="community"
+
+function stopTaosd {
+ echo "Stop taosd"
+ systemctl stop taosd
+ PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
+ while [ -n "$PID" ]
+ do
+ pkill -TERM -x taosd
+ sleep 1
+ PID=`ps -ef|grep -w taosd | grep -v grep | awk '{print $2}'`
+ done
+}
+
function dohavecore(){
corefile=`find $corepath -mmin 1`
if [ -n "$corefile" ];then
@@ -19,8 +34,7 @@ function dohavecore(){
function runSimCaseOneByOne {
while read -r line; do
if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then
- case=`echo $line | grep sim$ |awk '{print $NF}'`
- IN_TDINTERNAL="community"
+ case=`echo $line | grep sim$ |awk '{print $NF}'`
start_time=`date +%s`
date +%F\ %T | tee -a out.log
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
@@ -51,8 +65,7 @@ function runSimCaseOneByOnefq {
if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then
case=`echo $line | grep sim$ |awk '{print $NF}'`
- start_time=`date +%s`
- IN_TDINTERNAL="community"
+ start_time=`date +%s`
date +%F\ %T | tee -a out.log
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
echo -n $case
@@ -143,12 +156,13 @@ function runPyCaseOneByOnefq {
fi
done < $1
}
+
totalFailed=0
totalPyFailed=0
+totalJDBCFailed=0
-tests_dir=`pwd`
corepath=`grep -oP '.*(?=core_)' /proc/sys/kernel/core_pattern||grep -oP '.*(?=core-)' /proc/sys/kernel/core_pattern`
-if [ "$2" != "python" ]; then
+if [ "$2" != "jdbc" ] && [ "$2" != "python" ]; then
echo "### run TSIM test case ###"
cd $tests_dir/script
@@ -217,11 +231,10 @@ if [ "$2" != "python" ]; then
fi
fi
-if [ "$2" != "sim" ]; then
+if [ "$2" != "sim" ] && [ "$2" != "jdbc" ] ; then
echo "### run Python test case ###"
cd $tests_dir
- IN_TDINTERNAL="community"
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
cd ../..
@@ -286,4 +299,48 @@ if [ "$2" != "sim" ]; then
fi
fi
-exit $(($totalFailed + $totalPyFailed))
+
+if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$1" == "full" ]; then
+ echo "### run JDBC test case ###"
+
+ cd $tests_dir
+
+ if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
+ cd ../../
+ else
+ cd ../
+ fi
+
+ pwd
+ cd debug/
+
+ stopTaosd
+ nohup build/bin/taosd -c /etc/taos/ > /dev/null 2>&1 &
+ sleep 30
+
+ cd $tests_dir/../src/connector/jdbc
+
+ mvn test > jdbc-out.log 2>&1
+ tail -n 20 jdbc-out.log
+
+ cases=`grep 'Tests run' jdbc-out.log | awk 'END{print $3}'`
+ totalJDBCCases=`echo ${cases/%,}`
+ failed=`grep 'Tests run' jdbc-out.log | awk 'END{print $5}'`
+ JDBCFailed=`echo ${failed/%,}`
+ error=`grep 'Tests run' jdbc-out.log | awk 'END{print $7}'`
+ JDBCError=`echo ${error/%,}`
+
+ totalJDBCFailed=`expr $JDBCFailed + $JDBCError`
+ totalJDBCSuccess=`expr $totalJDBCCases - $totalJDBCFailed`
+
+ if [ "$totalJDBCSuccess" -gt "0" ]; then
+ echo -e "\n${GREEN} ### Total $totalJDBCSuccess JDBC case(s) succeed! ### ${NC}"
+ fi
+
+ if [ "$totalJDBCFailed" -ne "0" ]; then
+ echo -e "\n${RED} ### Total $totalJDBCFailed JDBC case(s) failed! ### ${NC}"
+ fi
+ dohavecore 1
+fi
+
+exit $(($totalFailed + $totalPyFailed + $totalJDBCFailed))