Merge pull request #48783 from KaiSforza/pr-lint-only-diff

Only run lint checks against changed files
This commit is contained in:
Daniel Wallace 2018-07-26 15:07:58 -05:00 committed by GitHub
commit 04cd9a346a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -29,13 +29,13 @@ pipeline {
parallel { parallel {
stage('salt linting') { stage('salt linting') {
steps { steps {
sh 'eval "$(pyenv init -)"; tox -e pylint-salt | tee pylint-report.xml' sh 'eval "$(pyenv init -)"; tox -e pylint-salt $(find salt/ -name "*.py" -exec git diff --name-only "origin/$CHANGE_TARGET" "origin/$BRANCH_NAME" setup.py {} +) | tee pylint-report.xml'
archiveArtifacts artifacts: 'pylint-report.xml' archiveArtifacts artifacts: 'pylint-report.xml'
} }
} }
stage('test linting') { stage('test linting') {
steps { steps {
sh 'eval "$(pyenv init -)"; tox -e pylint-tests | tee pylint-report-tests.xml' sh 'eval "$(pyenv init -)"; tox -e pylint-tests $(find tests/ -name "*.py" -exec git diff --name-only "origin/$CHANGE_TARGET" "origin/$BRANCH_NAME" {} +) | tee pylint-report-tests.xml'
archiveArtifacts artifacts: 'pylint-report-tests.xml' archiveArtifacts artifacts: 'pylint-report-tests.xml'
} }
} }
@ -49,7 +49,9 @@ pipeline {
parserName: 'PyLint', parserName: 'PyLint',
pattern: 'pylint-report*.xml' pattern: 'pylint-report*.xml'
]], ]],
failedTotalAll: '1', failedTotalAll: '0',
useDeltaValues: false,
canRunOnFailed: true,
usePreviousBuildAsReference: true usePreviousBuildAsReference: true
]) ])
cleanWs() cleanWs()

View File

@ -598,7 +598,7 @@ class TestSaltProgram(six.with_metaclass(TestSaltProgramMeta, TestProgram)):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try: try:
connect = sock.bind(('localhost', port)) connect = sock.bind(('localhost', port))
except: except OSError:
# these ports are already in use, use different ones # these ports are already in use, use different ones
pub_port = 4606 pub_port = 4606
ret_port = 4607 ret_port = 4607