From 2cc2a9cdc05860d78422e7cc64bf663d88a7e070 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 15 Dec 2020 17:54:03 +0800 Subject: [PATCH 01/10] fix jenkins error --- tests/Jenkinsfile | 248 ++++++++++++---------------------------------- 1 file changed, 64 insertions(+), 184 deletions(-) diff --git a/tests/Jenkinsfile b/tests/Jenkinsfile index e343de789e..550a0d29ed 100644 --- a/tests/Jenkinsfile +++ b/tests/Jenkinsfile @@ -1,3 +1,32 @@ +import hudson.model.Result +import jenkins.model.CauseOfInterruption +properties([pipelineTriggers([githubPush()])]) +node { + git url: 'https://github.com/taosdata/TDengine.git' +} + + +def abortPreviousBuilds() { + def currentJobName = env.JOB_NAME + def currentBuildNumber = env.BUILD_NUMBER.toInteger() + def jobs = Jenkins.instance.getItemByFullName(currentJobName) + def builds = jobs.getBuilds() + + for (build in builds) { + if (!build.isBuilding()) { + continue; + } + + if (currentBuildNumber == build.getNumber().toInteger()) { + continue; + } + + build.doKill() //doTerm(),doKill(),doTerm() + } +} +//停止之前相同的分支。。 +abortPreviousBuilds() + def pre_test(){ catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh ''' @@ -5,15 +34,17 @@ def pre_test(){ ''' } sh ''' + cd ${WKC} - git reset --hard - git checkout ${BRANCH} - git pull - git submodule update + rm -rf * cd ${WK} git reset --hard - git checkout ${BRANCH} + git checkout develop git pull + cd ${WKC} + rm -rf * + mv ${WORKSPACE}/* . + cd ${WK} export TZ=Asia/Harbin date rm -rf ${WK}/debug @@ -22,23 +53,30 @@ def pre_test(){ cmake .. > /dev/null make > /dev/null make install > /dev/null + cd ${WKC}/tests ''' return 1 } pipeline { agent none + environment{ - BRANCH = 'develop' WK = '/var/lib/jenkins/workspace/TDinternal' WKC= '/var/lib/jenkins/workspace/TDinternal/community' } - + stages { + + stage('Parallel test stage') { + //only pr triggering the build. + when { + changeRequest() + } parallel { - stage('pytest') { - agent{label '184'} - steps { + stage('python') { + agent{label 'pytest'} + steps { pre_test() sh ''' cd ${WKC}/tests @@ -47,15 +85,9 @@ pipeline { } } stage('test_b1') { - agent{label 'master'} - steps { + agent{label 'b1'} + steps { pre_test() - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - cd ${WKC}/tests/pytest - python3 concurrent_inquiry.py -c 1 - ''' - } sh ''' cd ${WKC}/tests ./test-all.sh b1 @@ -64,12 +96,9 @@ pipeline { } stage('test_crash_gen') { - agent{label "185"} + agent{label "b2"} steps { pre_test() - sh ''' - cd ${WKC}/tests/pytest - ''' catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh ''' cd ${WKC}/tests/pytest @@ -83,6 +112,7 @@ pipeline { ''' } sh ''' + date cd ${WKC}/tests ./test-all.sh b2 date @@ -91,177 +121,27 @@ pipeline { } stage('test_valgrind') { - agent{label "186"} + agent{label "b3"} steps { pre_test() + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + cd ${WKC}/tests/pytest + ./valgrind-test.sh 2>&1 > mem-error-out.log + ./handle_val_log.sh + ''' + } sh ''' - cd ${WKC}/tests/pytest - ./valgrind-test.sh 2>&1 > mem-error-out.log - ./handle_val_log.sh - date cd ${WKC}/tests ./test-all.sh b3 date''' } } - stage('connector'){ - agent{label "release"} - steps{ - sh''' - cd ${WORKSPACE} - git checkout develop - ''' - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - cd ${WORKSPACE}/tests/gotest - bash batchtest.sh - ''' - } - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - cd ${WORKSPACE}/tests/examples/python/PYTHONConnectorChecker - python3 PythonChecker.py - ''' - } - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - cd ${WORKSPACE}/tests/examples/JDBC/JDBCDemo/ - mvn clean package assembly:single >/dev/null - java -jar target/jdbcChecker-SNAPSHOT-jar-with-dependencies.jar -host 127.0.0.1 - ''' - } - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - cd ${JENKINS_HOME}/workspace/C#NET/src/CheckC# - dotnet run - ''' - } - - } - } - stage('arm64_build'){ - agent{label 'arm64'} - steps{ - sh ''' - cd ${WK} - git fetch - git checkout develop - git pull - cd ${WKC} - git fetch - git checkout develop - git pull - git submodule update - cd ${WKC}/packaging - ./release.sh -v cluster -c aarch64 -n 2.0.0.0 -m 2.0.0.0 - - ''' - } - } - stage('arm32_build'){ - agent{label 'arm32'} - steps{ - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - cd ${WK} - git fetch - git checkout develop - git pull - cd ${WKC} - git fetch - git checkout develop - git pull - git submodule update - cd ${WKC}/packaging - ./release.sh -v cluster -c aarch32 -n 2.0.0.0 -m 2.0.0.0 - - ''' - } - - } - } - } + } - } - post { - success { - emailext ( - subject: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", - body: ''' - - - - - - - - - - - - -

- 构建信息 -
-
    -
    -
  • 构建名称>>分支:${PROJECT_NAME}
  • -
  • 构建结果: Successful
  • -
  • 构建编号:${BUILD_NUMBER}
  • -
  • 触发用户:${CAUSE}
  • -
  • 变更概要:${CHANGES}
  • -
  • 构建地址:${BUILD_URL}
  • -
  • 构建日志:${BUILD_URL}console
  • -
  • 变更集:${JELLY_SCRIPT}
  • -
    -
-
- - ''', - to: "yqliu@taosdata.com,pxiao@taosdata.com", - from: "support@taosdata.com" - ) - } - failure { - emailext ( - subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", - body: ''' - - - - - - - - - - - - -

- 构建信息 -
-
    -
    -
  • 构建名称>>分支:${PROJECT_NAME}
  • -
  • 构建结果: Successful
  • -
  • 构建编号:${BUILD_NUMBER}
  • -
  • 触发用户:${CAUSE}
  • -
  • 变更概要:${CHANGES}
  • -
  • 构建地址:${BUILD_URL}
  • -
  • 构建日志:${BUILD_URL}console
  • -
  • 变更集:${JELLY_SCRIPT}
  • -
    -
-
- - ''', - to: "yqliu@taosdata.com,pxiao@taosdata.com", - from: "support@taosdata.com" - ) - } - } -} \ No newline at end of file + } + +} From fe4a31d5f9624e47ed1948075380aaf886de41f7 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Dec 2020 15:48:40 +0800 Subject: [PATCH 02/10] test appveyor on win32 --- .appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 559431e2f9..d211580875 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -3,6 +3,7 @@ os: Visual Studio 2015 environment: matrix: - ARCH: amd64 + - ARCH: x86 clone_folder: c:\dev\TDengine clone_depth: 1 @@ -18,7 +19,7 @@ build_script: - cd build - cmake -G "NMake Makefiles" .. - nmake install - + - echo Building platform=%PLATFORM% notifications: - provider: Email to: From bdde3b4e3478dd683c804f2edb97fad214d10446 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Dec 2020 16:00:21 +0800 Subject: [PATCH 03/10] test --- .appveyor.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d211580875..feb361b6d1 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,12 +4,14 @@ environment: matrix: - ARCH: amd64 - ARCH: x86 - +platform: + - x86 + - amd64 clone_folder: c:\dev\TDengine clone_depth: 1 init: - - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %ARCH% + - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %platform% before_build: - cd c:\dev\TDengine @@ -19,7 +21,7 @@ build_script: - cd build - cmake -G "NMake Makefiles" .. - nmake install - - echo Building platform=%PLATFORM% + - echo Building platform=%platform% notifications: - provider: Email to: From b696d22ded1a1ed68b2804ff187c20fceb3a3a93 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Dec 2020 16:02:11 +0800 Subject: [PATCH 04/10] test --- .appveyor.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index feb361b6d1..ab629e337c 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,17 +1,14 @@ version: 1.0.{build} os: Visual Studio 2015 -environment: - matrix: - - ARCH: amd64 - - ARCH: x86 -platform: + +Platform: - x86 - amd64 clone_folder: c:\dev\TDengine clone_depth: 1 init: - - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %platform% + - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %Platform% before_build: - cd c:\dev\TDengine From bf7c02d1270e35fb41a998751d1ea40e0a91810b Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Dec 2020 16:03:02 +0800 Subject: [PATCH 05/10] test --- .appveyor.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index ab629e337c..d4c2b20198 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,14 +1,15 @@ version: 1.0.{build} os: Visual Studio 2015 +environment: + matrix: + - ARCH: amd64 + - ARCH: x86 -Platform: - - x86 - - amd64 clone_folder: c:\dev\TDengine clone_depth: 1 init: - - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %Platform% + - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %ARCH% before_build: - cd c:\dev\TDengine @@ -18,7 +19,7 @@ build_script: - cd build - cmake -G "NMake Makefiles" .. - nmake install - - echo Building platform=%platform% + - echo Building platform=%ARCH% notifications: - provider: Email to: From f6956407ca41e543a096e4bbb9df06b785cd728c Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Dec 2020 16:15:27 +0800 Subject: [PATCH 06/10] [TD-2345]test appveyor on amd64/x86 --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index d4c2b20198..b4907f348f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -19,7 +19,7 @@ build_script: - cd build - cmake -G "NMake Makefiles" .. - nmake install - - echo Building platform=%ARCH% + notifications: - provider: Email to: From ddff163c769c7aa1151bf735a667581dcfd86ed2 Mon Sep 17 00:00:00 2001 From: Yiqing Liu Date: Thu, 17 Dec 2020 17:00:24 +0800 Subject: [PATCH 07/10] Delete Jenkinsfile --- tests/Jenkinsfile | 147 ---------------------------------------------- 1 file changed, 147 deletions(-) delete mode 100644 tests/Jenkinsfile diff --git a/tests/Jenkinsfile b/tests/Jenkinsfile deleted file mode 100644 index 550a0d29ed..0000000000 --- a/tests/Jenkinsfile +++ /dev/null @@ -1,147 +0,0 @@ -import hudson.model.Result -import jenkins.model.CauseOfInterruption -properties([pipelineTriggers([githubPush()])]) -node { - git url: 'https://github.com/taosdata/TDengine.git' -} - - -def abortPreviousBuilds() { - def currentJobName = env.JOB_NAME - def currentBuildNumber = env.BUILD_NUMBER.toInteger() - def jobs = Jenkins.instance.getItemByFullName(currentJobName) - def builds = jobs.getBuilds() - - for (build in builds) { - if (!build.isBuilding()) { - continue; - } - - if (currentBuildNumber == build.getNumber().toInteger()) { - continue; - } - - build.doKill() //doTerm(),doKill(),doTerm() - } -} -//停止之前相同的分支。。 -abortPreviousBuilds() - -def pre_test(){ - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - sudo rmtaos - ''' - } - sh ''' - - cd ${WKC} - rm -rf * - cd ${WK} - git reset --hard - git checkout develop - git pull - cd ${WKC} - rm -rf * - mv ${WORKSPACE}/* . - cd ${WK} - export TZ=Asia/Harbin - date - rm -rf ${WK}/debug - mkdir debug - cd debug - cmake .. > /dev/null - make > /dev/null - make install > /dev/null - cd ${WKC}/tests - ''' - return 1 -} -pipeline { - agent none - - environment{ - WK = '/var/lib/jenkins/workspace/TDinternal' - WKC= '/var/lib/jenkins/workspace/TDinternal/community' - } - - stages { - - - stage('Parallel test stage') { - //only pr triggering the build. - when { - changeRequest() - } - parallel { - stage('python') { - agent{label 'pytest'} - steps { - pre_test() - sh ''' - cd ${WKC}/tests - ./test-all.sh pytest - date''' - } - } - stage('test_b1') { - agent{label 'b1'} - steps { - pre_test() - sh ''' - cd ${WKC}/tests - ./test-all.sh b1 - date''' - } - } - - stage('test_crash_gen') { - agent{label "b2"} - steps { - pre_test() - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - cd ${WKC}/tests/pytest - ./crash_gen.sh -a -p -t 4 -s 2000 - ''' - } - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - cd ${WKC}/tests/pytest - ./handle_crash_gen_val_log.sh - ''' - } - sh ''' - date - cd ${WKC}/tests - ./test-all.sh b2 - date - ''' - } - } - - stage('test_valgrind') { - agent{label "b3"} - - steps { - pre_test() - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - cd ${WKC}/tests/pytest - ./valgrind-test.sh 2>&1 > mem-error-out.log - ./handle_val_log.sh - ''' - } - sh ''' - date - cd ${WKC}/tests - ./test-all.sh b3 - date''' - } - } - - } - } - } - -} From 4f19013e13365812eae8dd1bb900186cb0e40963 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Dec 2020 17:09:28 +0800 Subject: [PATCH 08/10] [TD-2345]test appveyor on amd64/x86 --- .appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index b4907f348f..fe4816688b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -19,11 +19,12 @@ build_script: - cd build - cmake -G "NMake Makefiles" .. - nmake install - + notifications: - provider: Email to: - sangshuduo@gmail.com + on_build_success: true on_build_failure: true on_build_status_changed: true From 51022921147221c1b3cb206a90905918375ecdc4 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Dec 2020 17:16:30 +0800 Subject: [PATCH 09/10] fix some errors --- tests/Jenkinsfile | 267 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 tests/Jenkinsfile diff --git a/tests/Jenkinsfile b/tests/Jenkinsfile new file mode 100644 index 0000000000..e343de789e --- /dev/null +++ b/tests/Jenkinsfile @@ -0,0 +1,267 @@ +def pre_test(){ + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + sudo rmtaos + ''' + } + sh ''' + cd ${WKC} + git reset --hard + git checkout ${BRANCH} + git pull + git submodule update + cd ${WK} + git reset --hard + git checkout ${BRANCH} + git pull + export TZ=Asia/Harbin + date + rm -rf ${WK}/debug + mkdir debug + cd debug + cmake .. > /dev/null + make > /dev/null + make install > /dev/null + ''' + return 1 +} +pipeline { + agent none + environment{ + BRANCH = 'develop' + WK = '/var/lib/jenkins/workspace/TDinternal' + WKC= '/var/lib/jenkins/workspace/TDinternal/community' + } + + stages { + stage('Parallel test stage') { + parallel { + stage('pytest') { + agent{label '184'} + steps { + pre_test() + sh ''' + cd ${WKC}/tests + ./test-all.sh pytest + date''' + } + } + stage('test_b1') { + agent{label 'master'} + steps { + pre_test() + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + cd ${WKC}/tests/pytest + python3 concurrent_inquiry.py -c 1 + ''' + } + sh ''' + cd ${WKC}/tests + ./test-all.sh b1 + date''' + } + } + + stage('test_crash_gen') { + agent{label "185"} + steps { + pre_test() + sh ''' + cd ${WKC}/tests/pytest + ''' + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + cd ${WKC}/tests/pytest + ./crash_gen.sh -a -p -t 4 -s 2000 + ''' + } + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + cd ${WKC}/tests/pytest + ./handle_crash_gen_val_log.sh + ''' + } + sh ''' + cd ${WKC}/tests + ./test-all.sh b2 + date + ''' + } + } + + stage('test_valgrind') { + agent{label "186"} + + steps { + pre_test() + sh ''' + cd ${WKC}/tests/pytest + ./valgrind-test.sh 2>&1 > mem-error-out.log + ./handle_val_log.sh + + date + cd ${WKC}/tests + ./test-all.sh b3 + date''' + } + } + stage('connector'){ + agent{label "release"} + steps{ + sh''' + cd ${WORKSPACE} + git checkout develop + ''' + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + cd ${WORKSPACE}/tests/gotest + bash batchtest.sh + ''' + } + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + cd ${WORKSPACE}/tests/examples/python/PYTHONConnectorChecker + python3 PythonChecker.py + ''' + } + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + cd ${WORKSPACE}/tests/examples/JDBC/JDBCDemo/ + mvn clean package assembly:single >/dev/null + java -jar target/jdbcChecker-SNAPSHOT-jar-with-dependencies.jar -host 127.0.0.1 + ''' + } + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + cd ${JENKINS_HOME}/workspace/C#NET/src/CheckC# + dotnet run + ''' + } + + } + } + stage('arm64_build'){ + agent{label 'arm64'} + steps{ + sh ''' + cd ${WK} + git fetch + git checkout develop + git pull + cd ${WKC} + git fetch + git checkout develop + git pull + git submodule update + cd ${WKC}/packaging + ./release.sh -v cluster -c aarch64 -n 2.0.0.0 -m 2.0.0.0 + + ''' + } + } + stage('arm32_build'){ + agent{label 'arm32'} + steps{ + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + cd ${WK} + git fetch + git checkout develop + git pull + cd ${WKC} + git fetch + git checkout develop + git pull + git submodule update + cd ${WKC}/packaging + ./release.sh -v cluster -c aarch32 -n 2.0.0.0 -m 2.0.0.0 + + ''' + } + + } + } + } + } + + } + post { + success { + emailext ( + subject: "SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", + body: ''' + + + + + + + + + + + + +

+ 构建信息 +
+
    +
    +
  • 构建名称>>分支:${PROJECT_NAME}
  • +
  • 构建结果: Successful
  • +
  • 构建编号:${BUILD_NUMBER}
  • +
  • 触发用户:${CAUSE}
  • +
  • 变更概要:${CHANGES}
  • +
  • 构建地址:${BUILD_URL}
  • +
  • 构建日志:${BUILD_URL}console
  • +
  • 变更集:${JELLY_SCRIPT}
  • +
    +
+
+ + ''', + to: "yqliu@taosdata.com,pxiao@taosdata.com", + from: "support@taosdata.com" + ) + } + failure { + emailext ( + subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", + body: ''' + + + + + + + + + + + + +

+ 构建信息 +
+
    +
    +
  • 构建名称>>分支:${PROJECT_NAME}
  • +
  • 构建结果: Successful
  • +
  • 构建编号:${BUILD_NUMBER}
  • +
  • 触发用户:${CAUSE}
  • +
  • 变更概要:${CHANGES}
  • +
  • 构建地址:${BUILD_URL}
  • +
  • 构建日志:${BUILD_URL}console
  • +
  • 变更集:${JELLY_SCRIPT}
  • +
    +
+
+ + ''', + to: "yqliu@taosdata.com,pxiao@taosdata.com", + from: "support@taosdata.com" + ) + } + } +} \ No newline at end of file From 1f2ee6fc07f0f9ce80ebccf3cfb4e7707c228c7f Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Fri, 18 Dec 2020 11:00:16 +0800 Subject: [PATCH 10/10] [TD-2465]add error sql --- tests/pytest/query/queryError.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/pytest/query/queryError.py b/tests/pytest/query/queryError.py index f1fd9c0dec..539ce5141f 100644 --- a/tests/pytest/query/queryError.py +++ b/tests/pytest/query/queryError.py @@ -56,6 +56,15 @@ class TDTestCase: # query .. order by non-time field tdSql.error("select * from st order by name") + # TD-2133 + tdSql.error("select diff(tagtype),bottom(tagtype,1) from dev_001") + + # TD-2190 + tdSql.error("select min(tagtype),max(tagtype) from dev_002 interval(1n) fill(prev)") + + # TD-2208 + tdSql.error("select diff(tagtype),top(tagtype,1) from dev_001") + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__)