Jenkinsfile 1.7 KB
Newer Older
Y
Yiqing Liu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
pipeline {
  agent any
  stages {
    stage('build TDengine') {
      steps {
        sh '''cd ${WORKSPACE}
export TZ=Asia/Harbin
date
rm -rf ${WORKSPACE}/debug
mkdir debug
cd debug
cmake .. > /dev/null
make > /dev/null
cd ${WORKSPACE}/debug'''
      }
    }

    stage('test_tsim') {
      parallel {
        stage('test') {
          steps {
            sh '''cd ${WORKSPACE}/tests
#./test-all.sh smoke
sudo ./test-all.sh full'''
          }
        }

        stage('test_crash_gen') {
          steps {
            sh '''cd ${WORKSPACE}/tests/pytest
sudo ./crash_gen.sh -a -p -t 4 -s 2000'''
          }
        }

        stage('test_valgrind') {
          steps {
            sh '''cd ${WORKSPACE}/tests/pytest
sudo ./valgrind-test.sh 2>&1 > mem-error-out.log
grep \'start to execute\\|ERROR SUMMARY\' mem-error-out.log|grep -v \'grep\'|uniq|tee uniq-mem-error-out.log

for memError in `grep \'ERROR SUMMARY\' uniq-mem-error-out.log | awk \'{print $4}\'`
do
  if [ -n "$memError" ]; then
    if [ "$memError" -gt 12 ]; then
      echo -e "${RED} ## Memory errors number valgrind reports is $memError.\\
               More than our threshold! ## ${NC}"
      travis_terminate $memError
    fi
  fi
done

grep \'start to execute\\|definitely lost:\' mem-error-out.log|grep -v \'grep\'|uniq|tee uniq-definitely-lost-out.log
for defiMemError in `grep \'definitely lost:\' uniq-definitely-lost-out.log | awk \'{print $7}\'`
do
  if [ -n "$defiMemError" ]; then
    if [ "$defiMemError" -gt 13 ]; then
      echo -e "${RED} ## Memory errors number valgrind reports \\
               Definitely lost is $defiMemError. More than our threshold! ## ${NC}"
      travis_terminate $defiMemError
    fi
  fi
done'''
          }
        }

      }
    }

  }
}