Jenkisfile: verification
Change-Id: I58829f1672c95bb76c765aa1ce86d808f9e50dfd Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/25836 Tested-by: Bjoern Pedersen <bjoern.pedersen@frm2.tum.de> Reviewed-by: Bjoern Pedersen <bjoern.pedersen@frm2.tum.de>
This commit is contained in:
parent
cc1632e07d
commit
7ea4e3955a
31
ci/Jenkinsfile
vendored
31
ci/Jenkinsfile
vendored
@ -30,6 +30,7 @@ def changedFiles = '';
|
|||||||
|
|
||||||
def run_pylint(pyver) {
|
def run_pylint(pyver) {
|
||||||
stage ('pylint-' + pyver) {
|
stage ('pylint-' + pyver) {
|
||||||
|
gerritPostCheck(["jenkins:pylint_${pyver}:"RUNNING"])
|
||||||
def status = 'OK'
|
def status = 'OK'
|
||||||
changedFiles = sh returnStdout: true, script: '''\
|
changedFiles = sh returnStdout: true, script: '''\
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
@ -56,8 +57,8 @@ fi
|
|||||||
withCredentials([string(credentialsId: 'GERRITHTTP',
|
withCredentials([string(credentialsId: 'GERRITHTTP',
|
||||||
variable: 'GERRITHTTP')]) {
|
variable: 'GERRITHTTP')]) {
|
||||||
sh """\
|
sh """\
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [ -f pylint_results.txt ] ; then
|
if [ -f pylint_results.txt ] ; then
|
||||||
/home/jenkins/tools2/bin/pylint2gerrit
|
/home/jenkins/tools2/bin/pylint2gerrit
|
||||||
mv pylint_results.txt pylint-${pyver}.txt
|
mv pylint_results.txt pylint-${pyver}.txt
|
||||||
else
|
else
|
||||||
@ -68,18 +69,15 @@ fi
|
|||||||
|
|
||||||
echo "pylint result: $res"
|
echo "pylint result: $res"
|
||||||
this.verifyresult.put('pylint'+pyver, 1)
|
this.verifyresult.put('pylint'+pyver, 1)
|
||||||
|
def cplyint ="SUCCESSFULL"
|
||||||
if ( res != 0 ) {
|
if ( res != 0 ) {
|
||||||
currentBuild.result='FAILURE'
|
currentBuild.result='FAILURE'
|
||||||
this.verifyresult.put('pylint'+ pyver, -1)
|
this.verifyresult.put('pylint'+ pyver, -1)
|
||||||
status = 'FAILURE'
|
status = 'FAILURE'
|
||||||
|
cpylint = "FAILED"
|
||||||
}
|
}
|
||||||
|
|
||||||
gerritverificationpublisher([
|
gerritPostCheck(["jenkins:pylint_${pyver}": cpylint])
|
||||||
verifyStatusValue: this.verifyresult['pylint'+pyver],
|
|
||||||
verifyStatusCategory: 'pylint ',
|
|
||||||
verifyStatusName: 'pylint-'+pyver,
|
|
||||||
verifyStatusReporter: 'jenkins',
|
|
||||||
verifyStatusRerun: '!recheck'])
|
|
||||||
archiveArtifacts([allowEmptyArchive: true,
|
archiveArtifacts([allowEmptyArchive: true,
|
||||||
artifacts: 'pylint-*.txt'])
|
artifacts: 'pylint-*.txt'])
|
||||||
recordIssues([enabledForFailure: true,
|
recordIssues([enabledForFailure: true,
|
||||||
@ -99,11 +97,13 @@ fi
|
|||||||
|
|
||||||
def run_tests(pyver) {
|
def run_tests(pyver) {
|
||||||
stage('Test:' + pyver) {
|
stage('Test:' + pyver) {
|
||||||
writeFile file: 'setup.cfg', text: '''
|
gerritPostCheck(["jenkins:pytest_${pyver}":"RUNNING"])
|
||||||
|
writeFile file: 'setup.cfg', text: '''
|
||||||
[tool:pytest]
|
[tool:pytest]
|
||||||
addopts = --junit-xml=pytest.xml --junit-prefix=''' + pyver
|
addopts = --junit-xml=pytest.xml --junit-prefix=''' + pyver
|
||||||
|
|
||||||
def status = "OK"
|
def status = "OK"
|
||||||
|
def cpytest = "SUCCESSFULL"
|
||||||
verifyresult.put(pyver, 0)
|
verifyresult.put(pyver, 0)
|
||||||
try {
|
try {
|
||||||
timeout(5) {
|
timeout(5) {
|
||||||
@ -120,8 +120,10 @@ make test
|
|||||||
} catch (all) {
|
} catch (all) {
|
||||||
currentBuild.result = 'FAILURE'
|
currentBuild.result = 'FAILURE'
|
||||||
status = 'FAILURE'
|
status = 'FAILURE'
|
||||||
|
cpytest= "FAILED"
|
||||||
verifyresult.put(pyver, -1)
|
verifyresult.put(pyver, -1)
|
||||||
}
|
}
|
||||||
|
gerritPostCheck(["jenkins:pytest_${pyver}":cpytest])
|
||||||
gerritverificationpublisher([
|
gerritverificationpublisher([
|
||||||
verifyStatusValue: verifyresult[pyver],
|
verifyStatusValue: verifyresult[pyver],
|
||||||
verifyStatusCategory: 'test ',
|
verifyStatusCategory: 'test ',
|
||||||
@ -185,13 +187,6 @@ def run_docs() {
|
|||||||
|
|
||||||
stage('store html doc for build') {
|
stage('store html doc for build') {
|
||||||
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'doc/_build/html', reportFiles: 'index.html', reportName: 'Built documentation', reportTitles: ''])
|
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'doc/_build/html', reportFiles: 'index.html', reportName: 'Built documentation', reportTitles: ''])
|
||||||
gerritverificationpublisher([
|
|
||||||
verifyStatusValue: 1,
|
|
||||||
verifyStatusCategory: 'test ',
|
|
||||||
verifyStatusName: 'doc',
|
|
||||||
verifyStatusReporter: 'jenkins',
|
|
||||||
verifyStatusRerun: '@recheck'
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -233,8 +228,8 @@ node("dockerhost") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage('execute tests') {
|
stage('execute tests') {
|
||||||
def img = docker.image('secop_base:latest')
|
def img = docker.image('secop_base:latest').pull()
|
||||||
def docimg = docker.image('secop_docs:latest')
|
def docimg = docker.image('secop_docs:latest').pull()
|
||||||
|
|
||||||
parallel 'Test': {
|
parallel 'Test': {
|
||||||
img.inside {
|
img.inside {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user