Fixes for check-uc jenkins job

Implement XFAIL handling for ignoring known problems so that
we can make the job voting until the remaining issues are sorted
out.

Change-Id: Ia2cf2c440a72e6365a9ff08086704dc535bbc072
This commit is contained in:
Dirk Mueller 2016-09-29 08:56:54 +02:00
parent bf46becbcf
commit d59c8ece29
4 changed files with 38 additions and 4 deletions

View File

@ -34,3 +34,7 @@ postgresql-client
libnss3-dev [platform:dpkg] libnss3-dev [platform:dpkg]
mozilla-nss-devel [platform:rpm] mozilla-nss-devel [platform:rpm]
nss-devel [platform:rpm] nss-devel [platform:rpm]
# NOTE(dirk) needed for PyECLib
liberasurecode-dev [platform:dpkg]
liberasurecode-devel [platform:rpm]
dev-libs/liberasurecode [platform:gentoo]

View File

@ -14,6 +14,8 @@
""" """
from __future__ import print_function
import argparse import argparse
import sys import sys
import traceback import traceback
@ -34,7 +36,11 @@ def main():
parser.add_argument( parser.add_argument(
'upper_constraints', 'upper_constraints',
default='upper-constraints.txt', default='upper-constraints.txt',
help='path to the upper-constraints.txt file', help='path to the upper-constraints.txt file')
parser.add_argument(
'uc_xfails',
default='upper-constraints-xfails.txt',
help='Path to the upper-constraints-xfails.txt file',
) )
args = parser.parse_args() args = parser.parse_args()
@ -42,16 +48,35 @@ def main():
print('\nChecking %s' % args.upper_constraints) print('\nChecking %s' % args.upper_constraints)
upper_constraints = read_requirements_file(args.upper_constraints) upper_constraints = read_requirements_file(args.upper_constraints)
xfails = read_requirements_file(args.uc_xfails)
for name, spec_list in upper_constraints.items(): for name, spec_list in upper_constraints.items():
try: try:
if name: if name:
print('Checking conflicts for %s' % name)
pyver = "python_version=='%s.%s'" % (sys.version_info[0], pyver = "python_version=='%s.%s'" % (sys.version_info[0],
sys.version_info[1]) sys.version_info[1])
for req, original_line in spec_list: for req, original_line in spec_list:
if req.markers in ["", pyver]: if req.markers in ["", pyver]:
pkg_resources.require(name) pkg_resources.require(name)
except pkg_resources.ContextualVersionConflict: except pkg_resources.ContextualVersionConflict as e:
if e.dist.key in xfails:
xfail_requirement = xfails[e.dist.key][0][0]
xfail_blacklists = set(xfail_requirement.markers.split(','))
conflict = e.dist.as_requirement()
conflict_specifiers = ''.join(conflict.specs[0])
if (e.required_by.issubset(xfail_blacklists) and
xfail_requirement.package == conflict.name and
conflict_specifiers == xfail_requirement.specifiers):
print ('XFAIL while checking conflicts '
'for %s: %s conflicts with %s' %
(name, e.dist, str(e.req)))
continue
print('Checking conflicts for %s:\n'
'ContextualVersionConflict: %s' % (name, str(e)))
traceback.print_exc(file=sys.stdout) traceback.print_exc(file=sys.stdout)
error_count += 1 error_count += 1

View File

@ -18,7 +18,7 @@ commands = check-conflicts {toxinidir}/upper-constraints.txt
[testenv:py27-check-uc] [testenv:py27-check-uc]
deps = -r{toxinidir}/upper-constraints.txt deps = -r{toxinidir}/upper-constraints.txt
commands = check-conflicts {toxinidir}/upper-constraints.txt commands = check-conflicts {toxinidir}/upper-constraints.txt {toxinidir}/upper-constraints-xfails.txt
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}

View File

@ -0,0 +1,5 @@
# Format is
# <dependency that is incompatible>==<version>;<list,of,affected,packages>
pyparsing==2.1.9;pulp
Sphinx==1.3.6;os-api-ref,openstack-doc-tools