Upgrade for ci
fixes outdated options and macros in Jenkinsfile fixes outdated options in pylintrc Change-Id: Ib064cc8b4235536c21288733676438297e15736d
This commit is contained in:
parent
b0051ca3f0
commit
aa98604f88
19
.pylintrc
19
.pylintrc
@ -38,26 +38,20 @@ confidence=
|
|||||||
# multiple time.
|
# multiple time.
|
||||||
disable=missing-docstring
|
disable=missing-docstring
|
||||||
,locally-disabled
|
,locally-disabled
|
||||||
,locally-enabled
|
|
||||||
,fixme
|
,fixme
|
||||||
,no-member
|
,no-member
|
||||||
,bad-whitespace
|
|
||||||
,wrong-import-position
|
,wrong-import-position
|
||||||
,ungrouped-imports
|
,ungrouped-imports
|
||||||
,import-self
|
,import-self
|
||||||
,bad-continuation
|
|
||||||
,protected-access
|
,protected-access
|
||||||
,unused-argument
|
,unused-argument
|
||||||
,duplicate-code
|
,duplicate-code
|
||||||
,attribute-defined-outside-init
|
,attribute-defined-outside-init
|
||||||
,access-member-before-definition
|
,access-member-before-definition
|
||||||
,no-self-use
|
|
||||||
,broad-except
|
,broad-except
|
||||||
,unneeded-not
|
,unneeded-not
|
||||||
,unidiomatic-typecheck
|
,unidiomatic-typecheck
|
||||||
,undefined-loop-variable
|
,undefined-loop-variable
|
||||||
,redefined-variable-type
|
|
||||||
,deprecated-lambda
|
|
||||||
|
|
||||||
[REPORTS]
|
[REPORTS]
|
||||||
|
|
||||||
@ -67,10 +61,6 @@ disable=missing-docstring
|
|||||||
|
|
||||||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
|
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
|
||||||
|
|
||||||
# Put messages in a separate file for each module / package specified on the
|
|
||||||
# command line instead of printing them on stdout. Reports (if any) will be
|
|
||||||
# written in a file name "pylint_global.[txt|html]".
|
|
||||||
files-output=no
|
|
||||||
|
|
||||||
# Tells whether to display a full report or only the messages
|
# Tells whether to display a full report or only the messages
|
||||||
reports=no
|
reports=no
|
||||||
@ -98,9 +88,6 @@ additional-builtins=
|
|||||||
|
|
||||||
[BASIC]
|
[BASIC]
|
||||||
|
|
||||||
# List of builtins function names that should not be used, separated by a comma
|
|
||||||
#bad-functions=map,filter,apply,input
|
|
||||||
bad-functions=apply,input
|
|
||||||
|
|
||||||
# Regular expression which should only match correct module names
|
# Regular expression which should only match correct module names
|
||||||
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9_]+))$
|
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9_]+))$
|
||||||
@ -155,12 +142,6 @@ notes=FIXME,XXX,TODO
|
|||||||
# Maximum number of characters on a single line.
|
# Maximum number of characters on a single line.
|
||||||
max-line-length=132
|
max-line-length=132
|
||||||
|
|
||||||
# List of optional constructs for which whitespace checking is disabled. `dict-
|
|
||||||
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
|
|
||||||
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
|
|
||||||
# `empty-line` allows space-only lines.
|
|
||||||
no-space-check=trailing-comma,dict-separator
|
|
||||||
|
|
||||||
# Maximum number of lines in a module
|
# Maximum number of lines in a module
|
||||||
max-module-lines=1000
|
max-module-lines=1000
|
||||||
|
|
||||||
|
27
ci/Jenkinsfile
vendored
27
ci/Jenkinsfile
vendored
@ -30,8 +30,6 @@ def changedFiles = '';
|
|||||||
|
|
||||||
def run_pylint(pyver) {
|
def run_pylint(pyver) {
|
||||||
stage ('pylint-' + pyver) {
|
stage ('pylint-' + pyver) {
|
||||||
def cpylint = "RUNNING"
|
|
||||||
gerritPostCheck(["jenkins:pylint_${pyver}": cpylint])
|
|
||||||
def status = 'OK'
|
def status = 'OK'
|
||||||
changedFiles = sh returnStdout: true, script: '''\
|
changedFiles = sh returnStdout: true, script: '''\
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
@ -45,14 +43,14 @@ git diff HEAD~1... --name-only --diff-filter=ARCM -- \\*.py
|
|||||||
pip install -r requirements-dev.txt
|
pip install -r requirements-dev.txt
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install isort pylint
|
pip install isort pylint
|
||||||
python3 setup.py develop
|
pip install -e .
|
||||||
export PYTHONIOENCODING=utf8
|
export PYTHONIOENCODING=utf8
|
||||||
|
|
||||||
echo "$changedFiles"
|
echo "$changedFiles"
|
||||||
if [[ -n "$changedFiles" ]]; then
|
if [[ -n "$changedFiles" ]]; then
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
pylint $changedFiles | tee pylint_results.txt
|
pylint $changedFiles | tee pylint_results.txt
|
||||||
isort -df $changedFiles | tee isort_results.txt
|
isort --df $changedFiles | tee isort_results.txt
|
||||||
fi
|
fi
|
||||||
"""
|
"""
|
||||||
withCredentials([string(credentialsId: 'GERRITHTTP',
|
withCredentials([string(credentialsId: 'GERRITHTTP',
|
||||||
@ -69,16 +67,11 @@ fi
|
|||||||
} // credentials
|
} // credentials
|
||||||
|
|
||||||
echo "pylint result: $res"
|
echo "pylint result: $res"
|
||||||
this.verifyresult.put('pylint'+pyver, 1)
|
|
||||||
cpylint = "SUCCESSFUL"
|
|
||||||
if ( res != 0 ) {
|
if ( res != 0 ) {
|
||||||
currentBuild.result='FAILURE'
|
currentBuild.result='FAILURE'
|
||||||
this.verifyresult.put('pylint'+ pyver, -1)
|
|
||||||
status = 'FAILURE'
|
status = 'FAILURE'
|
||||||
cpylint = "FAILED"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gerritPostCheck(["jenkins:pylint_${pyver}": cpylint])
|
|
||||||
archiveArtifacts([allowEmptyArchive: true,
|
archiveArtifacts([allowEmptyArchive: true,
|
||||||
artifacts: 'pylint-*.txt'])
|
artifacts: 'pylint-*.txt'])
|
||||||
recordIssues([enabledForFailure: true,
|
recordIssues([enabledForFailure: true,
|
||||||
@ -98,14 +91,11 @@ fi
|
|||||||
|
|
||||||
def run_tests(pyver) {
|
def run_tests(pyver) {
|
||||||
stage('Test:' + pyver) {
|
stage('Test:' + pyver) {
|
||||||
def cpytest = "RUNNING"
|
|
||||||
gerritPostCheck(["jenkins:pytest_${pyver}":"RUNNING"])
|
|
||||||
writeFile file: 'setup.cfg', text: '''
|
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"
|
||||||
verifyresult.put(pyver, 0)
|
|
||||||
try {
|
try {
|
||||||
timeout(5) {
|
timeout(5) {
|
||||||
sh '''\
|
sh '''\
|
||||||
@ -113,19 +103,14 @@ addopts = --junit-xml=pytest.xml --junit-prefix=''' + pyver
|
|||||||
. /home/jenkins/secopvenv/bin/activate
|
. /home/jenkins/secopvenv/bin/activate
|
||||||
pip install -r requirements-dev.txt
|
pip install -r requirements-dev.txt
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
python3 setup.py develop
|
pip install -e .
|
||||||
make test
|
make test
|
||||||
'''
|
'''
|
||||||
verifyresult.put(pyver, 1)
|
|
||||||
cpytest = "SUCCESSFUL"
|
|
||||||
}
|
}
|
||||||
} catch (all) {
|
} catch (all) {
|
||||||
currentBuild.result = 'FAILURE'
|
currentBuild.result = 'FAILURE'
|
||||||
status = 'FAILURE'
|
status = 'FAILURE'
|
||||||
cpytest= "FAILED"
|
|
||||||
verifyresult.put(pyver, -1)
|
|
||||||
}
|
}
|
||||||
gerritPostCheck(["jenkins:pytest_${pyver}":cpytest])
|
|
||||||
|
|
||||||
step([$class: 'JUnitResultArchiver', allowEmptyResults: true,
|
step([$class: 'JUnitResultArchiver', allowEmptyResults: true,
|
||||||
keepLongStdio: true, testResults: 'pytest.xml'])
|
keepLongStdio: true, testResults: 'pytest.xml'])
|
||||||
@ -136,14 +121,12 @@ make test
|
|||||||
}
|
}
|
||||||
|
|
||||||
def run_docs() {
|
def run_docs() {
|
||||||
def cdocs = "RUNNING"
|
|
||||||
gerritPostCheck(["jenkins:docs":cdocs])
|
|
||||||
stage('prepare') {
|
stage('prepare') {
|
||||||
sh '''
|
sh '''
|
||||||
. /home/jenkins/secopvenv/bin/activate
|
. /home/jenkins/secopvenv/bin/activate
|
||||||
pip install -r requirements-dev.txt
|
pip install -r requirements-dev.txt
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
python3 setup.py develop
|
pip install -e .
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,9 +168,7 @@ 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: ''])
|
||||||
cdocs = "SUCCESSFUL"
|
|
||||||
}
|
}
|
||||||
gerritPostCheck(["jenkins:docs":cdocs])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user