more merges from gerrit

Change-Id: I13441cd8889dd39f74a2dd1a85e75a1b76bb93c8
This commit is contained in:
2022-03-08 10:52:14 +01:00
parent 10018b8cad
commit 34b93adef0
20 changed files with 1423 additions and 340 deletions

40
ci/Jenkinsfile vendored
View File

@ -30,6 +30,8 @@ def changedFiles = '';
def run_pylint(pyver) {
stage ('pylint-' + pyver) {
def cpylint = "RUNNING"
gerritPostCheck(["jenkins:pylint_${pyver}": cpylint])
def status = 'OK'
changedFiles = sh returnStdout: true, script: '''\
#!/bin/bash
@ -56,8 +58,8 @@ fi
withCredentials([string(credentialsId: 'GERRITHTTP',
variable: 'GERRITHTTP')]) {
sh """\
#!/bin/bash
if [ -f pylint_results.txt ] ; then
#!/bin/bash
if [ -f pylint_results.txt ] ; then
/home/jenkins/tools2/bin/pylint2gerrit
mv pylint_results.txt pylint-${pyver}.txt
else
@ -68,18 +70,15 @@ fi
echo "pylint result: $res"
this.verifyresult.put('pylint'+pyver, 1)
cpylint = "SUCCESSFUL"
if ( res != 0 ) {
currentBuild.result='FAILURE'
this.verifyresult.put('pylint'+ pyver, -1)
status = 'FAILURE'
cpylint = "FAILED"
}
gerritverificationpublisher([
verifyStatusValue: this.verifyresult['pylint'+pyver],
verifyStatusCategory: 'pylint ',
verifyStatusName: 'pylint-'+pyver,
verifyStatusReporter: 'jenkins',
verifyStatusRerun: '!recheck'])
gerritPostCheck(["jenkins:pylint_${pyver}": cpylint])
archiveArtifacts([allowEmptyArchive: true,
artifacts: 'pylint-*.txt'])
recordIssues([enabledForFailure: true,
@ -99,7 +98,9 @@ fi
def run_tests(pyver) {
stage('Test:' + pyver) {
writeFile file: 'setup.cfg', text: '''
def cpytest = "RUNNING"
gerritPostCheck(["jenkins:pytest_${pyver}":"RUNNING"])
writeFile file: 'setup.cfg', text: '''
[tool:pytest]
addopts = --junit-xml=pytest.xml --junit-prefix=''' + pyver
@ -116,18 +117,15 @@ python3 setup.py develop
make test
'''
verifyresult.put(pyver, 1)
cpytest = "SUCCESSFUL"
}
} catch (all) {
currentBuild.result = 'FAILURE'
status = 'FAILURE'
cpytest= "FAILED"
verifyresult.put(pyver, -1)
}
gerritverificationpublisher([
verifyStatusValue: verifyresult[pyver],
verifyStatusCategory: 'test ',
verifyStatusName: 'pytest-'+pyver,
verifyStatusReporter: 'jenkins',
verifyStatusRerun: '!recheck'])
gerritPostCheck(["jenkins:pytest_${pyver}":cpytest])
step([$class: 'JUnitResultArchiver', allowEmptyResults: true,
keepLongStdio: true, testResults: 'pytest.xml'])
@ -138,6 +136,8 @@ make test
}
def run_docs() {
def cdocs = "RUNNING"
gerritPostCheck(["jenkins:docs":cdocs])
stage('prepare') {
sh '''
. /home/jenkins/secopvenv/bin/activate
@ -185,15 +185,9 @@ def run_docs() {
stage('store html doc for build') {
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'
])
cdocs = "SUCCESSFUL"
}
gerritPostCheck(["jenkins:docs":cdocs])
}