提交 e221d46c 编写于 作者: T tangfangzhi

add arm, macos build test

上级 613b844b
...@@ -4,7 +4,10 @@ import jenkins.model.CauseOfInterruption ...@@ -4,7 +4,10 @@ import jenkins.model.CauseOfInterruption
node { node {
} }
def sync_source() { def sync_source() {
sh 'hostname' sh '''
hostname
date
'''
sh ''' sh '''
cd ${WKC} cd ${WKC}
[ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md" [ -f src/connector/grafanaplugin/README.md ] && rm -f src/connector/grafanaplugin/README.md > /dev/null || echo "failed to remove grafanaplugin README.md"
...@@ -40,7 +43,7 @@ def sync_source() { ...@@ -40,7 +43,7 @@ def sync_source() {
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
echo "// git clean -dfx" git clean -dfx
git submodule update --init --recursive git submodule update --init --recursive
cd ${WK} cd ${WK}
git reset --hard HEAD~10 git reset --hard HEAD~10
...@@ -73,7 +76,7 @@ def sync_source() { ...@@ -73,7 +76,7 @@ def sync_source() {
git pull >/dev/null git pull >/dev/null
export TZ=Asia/Harbin export TZ=Asia/Harbin
date date
echo "// git clean -dfx" git clean -dfx
''' '''
} }
def pre_test() { def pre_test() {
...@@ -82,11 +85,23 @@ def pre_test() { ...@@ -82,11 +85,23 @@ def pre_test() {
cd ${WK} cd ${WK}
mkdir -p debug mkdir -p debug
cd debug cd debug
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GO111MODULE=on
cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true > /dev/null cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true > /dev/null
make -j8> /dev/null make -j8 >/dev/null
echo "make install > /dev/null" '''
cd ${WKC}/tests return 1
echo "pip3 install ${WKC}/src/connector/python/" }
def pre_test_mac() {
sync_source()
sh '''
cd ${WK}
mkdir -p debug
cd debug
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GO111MODULE=on
cmake .. -DBUILD_TOOLS=false > /dev/null
make -j8 >/dev/null
''' '''
return 1 return 1
} }
...@@ -94,9 +109,9 @@ pipeline { ...@@ -94,9 +109,9 @@ pipeline {
agent {label " dispatcher "} agent {label " dispatcher "}
options { skipDefaultCheckout() } options { skipDefaultCheckout() }
environment{ environment{
WK = '/root/jenkins/workspace/TDinternal' WK = '/var/data/jenkins/workspace/TDinternal'
WKC = '/root/jenkins/workspace/TDinternal/community' WKC = '/var/data/jenkins/workspace/TDinternal/community'
LOGDIR = '/root/jenkins/workspace/log' LOGDIR = '/var/data/jenkins/workspace/log'
} }
stages { stages {
stage ('pre_build') { stage ('pre_build') {
...@@ -121,8 +136,8 @@ pipeline { ...@@ -121,8 +136,8 @@ pipeline {
parallel { parallel {
stage ('dispatcher sync source') { stage ('dispatcher sync source') {
steps { steps {
sync_source() timeout(time: 20, unit: 'MINUTES') {
timeout(time: 100, unit: 'MINUTES') { sync_source()
script { script {
sh ''' sh '''
echo "dispatcher ready" echo "dispatcher ready"
...@@ -135,8 +150,8 @@ pipeline { ...@@ -135,8 +150,8 @@ pipeline {
stage ('build worker01') { stage ('build worker01') {
agent {label " worker01 "} agent {label " worker01 "}
steps { steps {
pre_test() timeout(time: 20, unit: 'MINUTES') {
timeout(time: 100, unit: 'MINUTES') { pre_test()
script { script {
sh ''' sh '''
echo "worker01 build done" echo "worker01 build done"
...@@ -149,8 +164,8 @@ pipeline { ...@@ -149,8 +164,8 @@ pipeline {
stage ('build worker02') { stage ('build worker02') {
agent {label " worker02 "} agent {label " worker02 "}
steps { steps {
pre_test() timeout(time: 20, unit: 'MINUTES') {
timeout(time: 100, unit: 'MINUTES') { pre_test()
script { script {
sh ''' sh '''
echo "worker02 build done" echo "worker02 build done"
...@@ -163,8 +178,8 @@ pipeline { ...@@ -163,8 +178,8 @@ pipeline {
stage ('build worker03') { stage ('build worker03') {
agent {label " worker03 "} agent {label " worker03 "}
steps { steps {
pre_test() timeout(time: 20, unit: 'MINUTES') {
timeout(time: 100, unit: 'MINUTES') { pre_test()
script { script {
sh ''' sh '''
echo "worker03 build done" echo "worker03 build done"
...@@ -177,8 +192,8 @@ pipeline { ...@@ -177,8 +192,8 @@ pipeline {
stage ('build worker04') { stage ('build worker04') {
agent {label " worker04 "} agent {label " worker04 "}
steps { steps {
pre_test() timeout(time: 20, unit: 'MINUTES') {
timeout(time: 100, unit: 'MINUTES') { pre_test()
script { script {
sh ''' sh '''
echo "worker04 build done" echo "worker04 build done"
...@@ -191,8 +206,8 @@ pipeline { ...@@ -191,8 +206,8 @@ pipeline {
stage ('build worker05') { stage ('build worker05') {
agent {label " worker05 "} agent {label " worker05 "}
steps { steps {
pre_test() timeout(time: 20, unit: 'MINUTES') {
timeout(time: 100, unit: 'MINUTES') { pre_test()
script { script {
sh ''' sh '''
echo "worker05 build done" echo "worker05 build done"
...@@ -205,19 +220,65 @@ pipeline { ...@@ -205,19 +220,65 @@ pipeline {
} }
} }
stage('run test') { stage('run test') {
steps { parallel {
sh ''' stage ('build worker06_arm64') {
date agent {label " worker06_arm64 "}
hostname steps {
''' timeout(time: 20, unit: 'MINUTES') {
timeout(time: 100, unit: 'MINUTES') { pre_test()
sh ''' script {
date sh '''
cd ${WKC}/tests/parallel_test echo "worker06_arm64 build done"
time ./run.sh -m m.json -t cases.task -l ${LOGDIR} -b ${BRANCH_NAME} date
date '''
hostname }
''' }
}
}
stage ('build worker07_arm64') {
agent {label " worker07_arm64 "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test()
script {
sh '''
echo "worker07_arm64 build done"
date
'''
}
}
}
}
stage ('build Mac_catalina ') {
agent {label " Mac_catalina "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test_mac()
script {
sh '''
echo "Mac_catalina build done"
date
'''
}
}
}
}
stage('run cases') {
steps {
sh '''
date
hostname
'''
timeout(time: 60, unit: 'MINUTES') {
sh '''
date
cd ${WKC}/tests/parallel_test
time ./run.sh -m m.json -t cases.task -l ${LOGDIR} -b ${BRANCH_NAME}
date
hostname
'''
}
}
} }
} }
} }
......
[{ [{
"host":"192.168.0.210", "host":"192.168.0.210",
"username":"root", "username":"root",
"workdir":"/root/jenkins/workspace", "workdir":"/var/data/jenkins/workspace",
"thread":25 "thread":25
}, },
{ {
"host":"192.168.0.211", "host":"192.168.0.211",
"username":"root", "username":"root",
"workdir":"/root/jenkins/workspace", "workdir":"/var/data/jenkins/workspace",
"thread":25 "thread":25
}, },
{ {
"host":"192.168.0.212", "host":"192.168.0.212",
"username":"root", "username":"root",
"workdir":"/root/jenkins/workspace", "workdir":"/var/data/jenkins/workspace",
"thread":25 "thread":25
}, },
{ {
"host":"192.168.0.213", "host":"192.168.0.213",
"username":"root", "username":"root",
"workdir":"/root/jenkins/workspace", "workdir":"/var/data/jenkins/workspace",
"thread":25 "thread":25
}, },
{ {
"host":"192.168.0.214", "host":"192.168.0.214",
"username":"root", "username":"root",
"workdir":"/root/jenkins/workspace", "workdir":"/var/data/jenkins/workspace",
"thread":25 "thread":25
}] }]
...@@ -269,7 +269,9 @@ function run_thread() { ...@@ -269,7 +269,9 @@ function run_thread() {
local corefile=`ls $log_dir/${case_file}.coredump/` local corefile=`ls $log_dir/${case_file}.coredump/`
corefile=`find $log_dir/${case_file}.coredump/ -name "core.*"` corefile=`find $log_dir/${case_file}.coredump/ -name "core.*"`
echo -e "$case_info \e[31m failed\e[0m" echo -e "$case_info \e[31m failed\e[0m"
echo "=========================log============================"
cat $log_dir/$case_file.log cat $log_dir/$case_file.log
echo "====================================================="
echo -e "\e[34m log file: $log_dir/$case_file.log \e[0m" echo -e "\e[34m log file: $log_dir/$case_file.log \e[0m"
if [ ! -z $corefile ]; then if [ ! -z $corefile ]; then
echo -e "\e[34m corefiles: $corefile \e[0m" echo -e "\e[34m corefiles: $corefile \e[0m"
...@@ -347,4 +349,6 @@ fi ...@@ -347,4 +349,6 @@ fi
echo "${log_dir}" >&2 echo "${log_dir}" >&2
date
exit $RET exit $RET
...@@ -97,3 +97,6 @@ docker run \ ...@@ -97,3 +97,6 @@ docker run \
-e PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$CONTAINER_TESTDIR/debug/build/bin:/usr/local/go/bin:/usr/local/node-v12.20.0-linux-x64/bin:/usr/local/apache-maven-3.8.4/bin:/usr/local/jdk1.8.0_144/bin \ -e PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$CONTAINER_TESTDIR/debug/build/bin:/usr/local/go/bin:/usr/local/node-v12.20.0-linux-x64/bin:/usr/local/apache-maven-3.8.4/bin:/usr/local/jdk1.8.0_144/bin \
-e JAVA_HOME=/usr/local/jdk1.8.0_144 \ -e JAVA_HOME=/usr/local/jdk1.8.0_144 \
--rm --ulimit core=-1 taos_test:v1.0 $CONTAINER_TESTDIR/tests/parallel_test/run_case.sh -d "$exec_dir" -c "$cmd" --rm --ulimit core=-1 taos_test:v1.0 $CONTAINER_TESTDIR/tests/parallel_test/run_case.sh -d "$exec_dir" -c "$cmd"
ret=$?
exit $ret
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册