add windows build test

This commit is contained in:
tangfangzhi 2022-04-28 14:55:31 +08:00
parent 8989579525
commit b11b2b966c
1 changed files with 178 additions and 106 deletions

View File

@ -33,7 +33,7 @@ def abort_previous(){
milestone(buildNumber) milestone(buildNumber)
} }
def pre_test(){ def pre_test(){
sh'hostname' sh 'hostname'
sh ''' sh '''
date date
sudo rmtaos || echo "taosd has not installed" sudo rmtaos || echo "taosd has not installed"
@ -50,35 +50,32 @@ def pre_test(){
cd ${WKC} cd ${WKC}
git checkout master git checkout master
''' '''
} } else if(env.CHANGE_TARGET == '2.0') {
else if(env.CHANGE_TARGET == '2.0'){
sh ''' sh '''
cd ${WKC} cd ${WKC}
git checkout 2.0 git checkout 2.0
''' '''
} } else if(env.CHANGE_TARGET == '3.0') {
else if(env.CHANGE_TARGET == '3.0'){
sh ''' sh '''
cd ${WKC} cd ${WKC}
git checkout 3.0 git checkout 3.0
[ -d contrib/bdb ] && cd contrib/bdb && git clean -fxd && cd ../.. [ -d contrib/bdb ] && cd contrib/bdb && git clean -fxd && cd ../..
''' '''
} } else {
else{
sh ''' sh '''
cd ${WKC} cd ${WKC}
git checkout develop git checkout develop
''' '''
} }
} }
sh''' sh '''
cd ${WKC} cd ${WKC}
git pull >/dev/null git pull >/dev/null
git fetch origin +refs/pull/${CHANGE_ID}/merge git fetch origin +refs/pull/${CHANGE_ID}/merge
git checkout -qf FETCH_HEAD git checkout -qf FETCH_HEAD
git submodule update --init --recursive git submodule update --init --recursive
''' '''
sh''' sh '''
cd ${WKC} cd ${WKC}
export TZ=Asia/Harbin export TZ=Asia/Harbin
date date
@ -88,7 +85,7 @@ def pre_test(){
cmake .. > /dev/null cmake .. > /dev/null
make -j4> /dev/null make -j4> /dev/null
''' '''
sh''' sh '''
cd ${WKPY} cd ${WKPY}
git reset --hard git reset --hard
git pull git pull
@ -96,6 +93,70 @@ def pre_test(){
''' '''
return 1 return 1
} }
def pre_test_win(){
bat '''
hostname
date /t
time /t
taskkill /f /t /im python.exe
taskkill /f /t /im bash.exe
cd C:\\workspace\\TDengine
rd /s /Q C:\\workspace\\TDengine\\debug
exit 0
'''
bat '''
cd C:\\workspace\\TDengine
git reset --hard
git fetch || git fetch
git checkout -f
'''
script {
if (env.CHANGE_TARGET == 'master') {
bat '''
cd C:\\workspace\\TDengine
git checkout master
'''
} else if(env.CHANGE_TARGET == '2.0') {
bat '''
cd C:\\workspace\\TDengine
git checkout 2.0
'''
} else if(env.CHANGE_TARGET == '3.0') {
bat '''
cd C:\\workspace\\TDengine
git checkout 3.0
'''
} else {
bat '''
cd C:\\workspace\\TDengine
git checkout develop
'''
}
}
bat '''
cd C:\\workspace\\TDengine
git branch
git pull || git pull
git clean -dfx
git fetch origin +refs/pull/%CHANGE_ID%/merge
git checkout -qf FETCH_HEAD
'''
}
def pre_test_build_win() {
bat '''
echo "building ..."
time /t
cd C:\\workspace\\TDengine
mkdir debug
cd debug
call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" x64
set CL=/MP8
cmake ../ -G "NMake Makefiles"
nmake || exit 8
time /t
'''
return 1
}
pipeline { pipeline {
agent none agent none
@ -106,29 +167,38 @@ pipeline {
WKPY= '/var/lib/jenkins/workspace/taos-connector-python' WKPY= '/var/lib/jenkins/workspace/taos-connector-python'
} }
stages { stages {
stage('pre_build'){ stage('run test') {
parallel {
stage('windows test') {
agent {label " windows11 "}
steps {
pre_test_win()
pre_test_build_win()
}
}
stage('linux test') {
agent{label " slave3_0 || slave15 || slave16 || slave17 "} agent{label " slave3_0 || slave15 || slave16 || slave17 "}
options { skipDefaultCheckout() } options { skipDefaultCheckout() }
when { when {
changeRequest() changeRequest()
} }
steps { steps {
script{ script {
abort_previous() abort_previous()
abortPreviousBuilds() abortPreviousBuilds()
} }
timeout(time: 45, unit: 'MINUTES'){ timeout(time: 45, unit: 'MINUTES'){
pre_test() pre_test()
sh''' sh '''
cd ${WKC}/debug cd ${WKC}/debug
ctest -VV ctest -VV
''' '''
sh''' sh '''
export LD_LIBRARY_PATH=${WKC}/debug/build/lib export LD_LIBRARY_PATH=${WKC}/debug/build/lib
cd ${WKC}/tests/system-test cd ${WKC}/tests/system-test
./fulltest.sh ./fulltest.sh
''' '''
sh''' sh '''
cd ${WKC}/tests cd ${WKC}/tests
./test-all.sh b1fq ./test-all.sh b1fq
''' '''
@ -136,6 +206,8 @@ pipeline {
} }
} }
} }
}
}
post { post {
success { success {
emailext ( emailext (