Skip to content

Commit

Permalink
Make jenkins python2 checks optional
Browse files Browse the repository at this point in the history
  • Loading branch information
amaltaro committed Jan 31, 2022
1 parent f1b2970 commit cc5c7df
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions jenkins_python/scripts/PullRequestReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ def buildPyFutureReport(templateEnv):
html.write(py3UnitTestSummaryHTML)
if py2UnitTestSummary:
html.write(py2UnitTestSummaryHTML)
html.write(pylintSummaryHTML)
html.write(pylintReport)
if pylintSummaryHTML:
html.write(pylintSummaryHTML)
if pylintReport:
html.write(pylintReport)
if pylintSummaryPy3:
html.write(pylintSummaryHTMLPy3)
html.write(pylintReportPy3)
Expand Down Expand Up @@ -353,13 +355,14 @@ def buildPyFutureReport(templateEnv):
if py3UnitTestSummary['unstableChanges']:
message += ' * %s changes in unstable tests\n' % py3UnitTestSummary['unstableChanges']

message += ' * Python2 Pylint check: %s\n' % statusMap[failedPylint]['readStatus']
if pylintSummary['failures']:
message += ' * %s warnings and errors that must be fixed\n' % pylintSummary['failures']
if pylintSummary['warnings']:
message += ' * %s warnings\n' % pylintSummary['warnings']
if pylintSummary['comments']:
message += ' * %s comments to review\n' % pylintSummary['comments']
if pylintSummary:
message += ' * Python2 Pylint check: %s\n' % statusMap[failedPylint]['readStatus']
if pylintSummary['failures']:
message += ' * %s warnings and errors that must be fixed\n' % pylintSummary['failures']
if pylintSummary['warnings']:
message += ' * %s warnings\n' % pylintSummary['warnings']
if pylintSummary['comments']:
message += ' * %s comments to review\n' % pylintSummary['comments']

if pylintSummaryPy3:
message += ' * Python3 Pylint check: %s\n' % statusMap[failedPylintPy3]['readStatus']
Expand Down Expand Up @@ -397,8 +400,10 @@ def buildPyFutureReport(templateEnv):

timeNow = time.strftime("%d %b %Y %H:%M GMT")
lastCommit = repo.get_pull(int(issueID)).get_commits().get_page(0)[-1]
lastCommit.create_status(state=statusMap[failedPylint]['ghStatus'], target_url=reportURL + '#pylintpy2',
description='Finished at %s' % timeNow, context='Py2 Pylint')

if pylintSummary:
lastCommit.create_status(state=statusMap[failedPylint]['ghStatus'], target_url=reportURL + '#pylintpy2',
description='Finished at %s' % timeNow, context='Py2 Pylint')
if pylintSummaryPy3:
lastCommit.create_status(state=statusMap[failedPylint]['ghStatus'], target_url=reportURL + '#pylintpy3',
description='Finished at %s' % timeNow, context='Py3 Pylint')
Expand All @@ -415,21 +420,23 @@ def buildPyFutureReport(templateEnv):
lastCommit.create_status(state=statusMap[failedPyFuture]['ghStatus'], target_url=reportURL + '#pyfuture',
description='Finished at %s' % timeNow, context='Python3 compatibility')

if failedPylint:
print('Testing of python code. DMWM-FAIL-PYLINT')
else:
print('Testing of python code. DMWM-SUCCEED-PYLINT')
if pylintSummary:
if failedPylint:
print('Testing of python code. DMWM-FAIL-PYLINT')
else:
print('Testing of python code. DMWM-SUCCEED-PYLINT')

if pylintSummary3k:
if failedPy3k:
print('Testing of python code. DMWM-FAIL-PYLINT3K')
elif pylintSummary3k:
print('Testing of python code. DMWM-SUCCEED-PYLINT3k')

if py2FailedUnitTests:
print('Testing of python code. DMWM-FAIL-PY2-UNIT')
else:
print('Testing of python code. DMWM-SUCCEED-PY2-UNIT')
if py2UnitTestSummary:
if py2FailedUnitTests:
print('Testing of python code. DMWM-FAIL-PY2-UNIT')
else:
print('Testing of python code. DMWM-SUCCEED-PY2-UNIT')

if py3UnitTestSummary:
if py3FailedUnitTests:
Expand Down

0 comments on commit cc5c7df

Please sign in to comment.