Jenkinsfile 3.8 KB
Newer Older
Y
Yiqing Liu 已提交
1
pipeline {
L
liuyq-617 已提交
2 3 4 5 6
  agent none
  environment{
      WK = '/var/lib/jenkins/workspace/TDinternal'
      WKC= '/var/lib/jenkins/workspace/TDinternal/community'
  }
Y
Yiqing Liu 已提交
7 8
  stages {
    stage('build TDengine') {
L
liuyq-617 已提交
9
      agent{label 'master'}
Y
Yiqing Liu 已提交
10
      steps {
L
liuyq-617 已提交
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
        sh '''
        cd ${WKC}
        git checkout develop
        git pull
        git submodule update
        cd ${WK}
        git checkout develop
        git pull
        export TZ=Asia/Harbin
        date
        rm -rf ${WK}/debug
        mkdir debug
        cd debug
        #cmake .. > /dev/null
        #make > /dev/null
        '''
Y
Yiqing Liu 已提交
27 28 29
      }
    }

L
liuyq-617 已提交
30
    stage('Parallel test stage') {
Y
Yiqing Liu 已提交
31
      parallel {
L
liuyq-617 已提交
32 33
        stage('test_b1') {
          agent{label '184'}
Y
Yiqing Liu 已提交
34
          steps {
L
liuyq-617 已提交
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
            sh '''
            date
            cd ${WKC}
            git checkout develop
            git pull
            git submodule update
            cd ${WK}
            git checkout develop
            git pull
            export TZ=Asia/Harbin
            date
            rm -rf ${WK}/debug
            mkdir debug
            cd debug
            cmake .. > /dev/null
            make > /dev/null
            cd ${WKC}/tests
            #./test-all.sh smoke
L
liuyq-617 已提交
53
            ./test-all.sh b1
L
liuyq-617 已提交
54
            date'''
Y
Yiqing Liu 已提交
55 56 57 58
          }
        }

        stage('test_crash_gen') {
L
liuyq-617 已提交
59
          agent{label "185"}
Y
Yiqing Liu 已提交
60
          steps {
L
liuyq-617 已提交
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
            sh '''
            date
            cd ${WKC}
            git checkout develop
            git pull
            git submodule update
            cd ${WK}
            git checkout develop
            git pull
            export TZ=Asia/Harbin
            date
            rm -rf ${WK}/debug
            mkdir debug
            cd debug
            cmake .. > /dev/null
            make > /dev/null
            cd ${WKC}/tests/pytest
L
liuyq-617 已提交
78
            ./crash_gen.sh -a -p -t 4 -s 2000
L
liuyq-617 已提交
79 80
            date
            cd ${WKC}/tests
L
liuyq-617 已提交
81
            ./test-all.sh b2
L
liuyq-617 已提交
82 83
            date
            '''
Y
Yiqing Liu 已提交
84 85 86 87
          }
        }

        stage('test_valgrind') {
L
liuyq-617 已提交
88
          agent{label "186"}
Y
Yiqing Liu 已提交
89
          steps {
L
liuyq-617 已提交
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
            sh '''
            date
            cd ${WKC}
            git checkout develop
            git pull
            git submodule update
            cd ${WK}
            git checkout develop
            git pull
            export TZ=Asia/Harbin
            date
            rm -rf ${WK}/debug
            mkdir debug
            cd debug
            cmake .. > /dev/null
            make > /dev/null
            cd ${WKC}/tests/pytest
L
liuyq-617 已提交
107
            ./valgrind-test.sh 2>&1 > mem-error-out.log
L
liuyq-617 已提交
108
            grep \'start to execute\\|ERROR SUMMARY\' mem-error-out.log|grep -v \'grep\'|uniq|tee uniq-mem-error-out.log
Y
Yiqing Liu 已提交
109

L
liuyq-617 已提交
110 111 112 113 114 115 116 117 118 119
            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
Y
Yiqing Liu 已提交
120

L
liuyq-617 已提交
121 122 123 124 125 126 127 128 129 130 131 132
            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
            date
L
liuyq-617 已提交
133 134
            cd ${WKC}/tests
            ./test-all.sh b3
L
liuyq-617 已提交
135
            date'''
Y
Yiqing Liu 已提交
136 137 138 139 140 141 142
          }
        }

      }
    }

  }
L
liuyq-617 已提交
143
}