update jenkins tests to use tox for lint

This commit is contained in:
Daniel Wallace 2018-07-06 13:35:06 -05:00
parent 44aaac1d33
commit c7a3a7d8bd
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48
2 changed files with 14 additions and 7 deletions

View file

@ -16,8 +16,7 @@ pipeline {
stage('setup') {
steps {
sh 'eval "$(pyenv init -)"; pyenv install 2.7.14 || echo "We already have this python."; pyenv local 2.7.14; pyenv shell 2.7.14'
sh 'eval "$(pyenv init -)"; pip install pylint SaltPyLint'
sh 'eval "$(pyenv init -)"; which pylint; pylint --version'
sh 'eval "$(pyenv init -)"; pip install tox'
}
}
stage('linting') {
@ -25,13 +24,13 @@ pipeline {
parallel {
stage('salt linting') {
steps {
sh 'eval "$(pyenv init -)"; pylint --rcfile=.testing.pylintrc --disable=W1307,str-format-in-logging setup.py salt/ | tee pylint-report.xml'
sh 'eval "$(pyenv init -)"; tox -e pylint-salt | tee pylint-report.xml'
archiveArtifacts artifacts: 'pylint-report.xml'
}
}
stage('test linting') {
steps {
sh 'eval "$(pyenv init -)"; pylint --rcfile=.testing.pylintrc --disable=W0232,E1002,W1307,str-format-in-logging tests/ | tee pylint-report-tests.xml'
sh 'eval "$(pyenv init -)"; tox -e pylint-tests | tee pylint-report-tests.xml'
archiveArtifacts artifacts: 'pylint-report-tests.xml'
}
}

14
tox.ini
View file

@ -1,5 +1,5 @@
[tox]
envlist = py27,py34,py35,py36,pylint
envlist = py27,py34,py35,py36,pylint-salt,pylint-tests
skip_missing_interpreters = True
skipsdist = True
@ -9,12 +9,20 @@ commands = pytest --rootdir {toxinidir} {posargs}
passenv = LANG HOME
sitepackages = True
[testenv:pylint]
[testenv:pylint-salt]
basepython = python2.7
deps = -r{toxinidir}/requirements/dev.txt
commands =
pylint --version
pylint --rcfile=.testing.pylintrc --disable=W1307,str-format-in-logging setup.py salt/
sitepackages = False
[testenv:pylint-tests]
basepython = python2.7
deps = -r{toxinidir}/requirements/dev.txt
commands =
pylint --version
pylint --rcfile=.testing.pylintrc --disable=W1307,str-format-in-logging setup.py salt/
pylint --rcfile=.testing.pylintrc --disable=W0232,E1002,W1307,str-format-in-logging tests/
sitepackages = False
[pytest]