diff --git a/Jenkinsfile b/Jenkinsfile index d96eeaa724..e1bb27bf67 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,7 @@ node { } def skipstage=0 + def abortPreviousBuilds() { def currentJobName = env.JOB_NAME def currentBuildNumber = env.BUILD_NUMBER.toInteger() @@ -24,7 +25,7 @@ def abortPreviousBuilds() { build.doKill() //doTerm(),doKill(),doTerm() } } -//abort previous build +// abort previous build abortPreviousBuilds() def abort_previous(){ def buildNumber = env.BUILD_NUMBER as int @@ -32,7 +33,8 @@ def abort_previous(){ milestone(buildNumber) } def pre_test(){ - + + sh ''' sudo rmtaos || echo "taosd has not installed" ''' @@ -79,6 +81,10 @@ pipeline { changeRequest() } steps { + script{ + abort_previous() + abortPreviousBuilds() + } sh''' cp -r ${WORKSPACE} ${WORKSPACE}.tes cd ${WORKSPACE}.tes diff --git a/tests/test-all.sh b/tests/test-all.sh index b5e23c1506..b8f06d8ede 100755 --- a/tests/test-all.sh +++ b/tests/test-all.sh @@ -100,7 +100,10 @@ function runSimCaseOneByOnefq { cp -r ../../sim ~/sim_`date "+%Y_%m_%d_%H:%M:%S" ` rm -rf ../../sim/case.log fi - exit 8 + dohavecore $2 + if [[ $2 == 1 ]];then + exit 8 + fi fi end_time=`date +%s` echo execution time of $case was `expr $end_time - $start_time`s. | tee -a out.log @@ -169,10 +172,13 @@ function runPyCaseOneByOnefq() { out_log=`tail -1 pytest-out.log ` if [[ $out_log =~ 'failed' ]];then cp -r ../../sim ~/sim_`date "+%Y_%m_%d_%H:%M:%S" ` - echo '=====================log=====================' + echo '=====================log===================== ' cat ../../sim/case.log rm -rf ../../sim/case.log - exit 8 + dohavecore $2 + if [[ $2 == 1 ]];then + exit 8 + fi fi echo execution time of $case was `expr $end_time - $start_time`s. | tee -a pytest-out.log else