Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-10264

OpenShift-Ansible BYOH Unit Tests are Broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • 4.8.0
    • None
    • No
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      Unit Tests are failing with:
      
      Collecting ansible<2.10
        Downloading https://files.pythonhosted.org/packages/5b/99/ce005d0314840e1a6eef34e0faf0ba4f7bccd8172b33cc84fee21afab7ad/ansible-2.9.27.tar.gz (14.8MB)
      ERROR: Exception:
      Traceback (most recent call last):
        File "/go/src/github.com/openshift/openshift-ansible/.tox/py36-unit/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
          status = self.run(options, args)
        File "/go/src/github.com/openshift/openshift-ansible/.tox/py36-unit/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 382, in run
          resolver.resolve(requirement_set)
        File "/go/src/github.com/openshift/openshift-ansible/.tox/py36-unit/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
          self._resolve_one(requirement_set, req)
        File "/go/src/github.com/openshift/openshift-ansible/.tox/py36-unit/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
          abstract_dist = self._get_abstract_dist_for(req_to_install)
        File "/go/src/github.com/openshift/openshift-ansible/.tox/py36-unit/lib/python3.6/site-packages/pip/_internal/legacy_resolve.py", line 313, in _get_abstract_dist_for
          req, self.session, self.finder, self.require_hashes
        File "/go/src/github.com/openshift/openshift-ansible/.tox/py36-unit/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 194, in prepare_linked_requirement
          progress_bar=self.progress_bar
        File "/go/src/github.com/openshift/openshift-ansible/.tox/py36-unit/lib/python3.6/site-packages/pip/_internal/download.py", line 465, in unpack_url
          progress_bar=progress_bar
        File "/go/src/github.com/openshift/openshift-ansible/.tox/py36-unit/lib/python3.6/site-packages/pip/_internal/download.py", line 320, in unpack_http_url
          unpack_file(from_path, location, content_type)
        File "/go/src/github.com/openshift/openshift-ansible/.tox/py36-unit/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 261, in unpack_file
          untar_file(filename, location)
        File "/go/src/github.com/openshift/openshift-ansible/.tox/py36-unit/lib/python3.6/site-packages/pip/_internal/utils/unpacking.py", line 222, in untar_file
          with open(path, 'wb') as destfp:
      UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 79: ordinal not in range(128)
      WARNING: You are using pip version 19.3.1; however, version 21.3.1 is available.
      You should consider upgrading via the 'pip install --upgrade pip' command.
      
      example: https://storage.googleapis.com/origin-ci-test/pr-logs/pull/openshift_openshift-ansible/12362/pull-ci-openshift-openshift-ansible-master-unit/1479458204667613184/build-log.txt
      
      This failure is occurring when trying to run tox in the centos:7 base image due to incompatibility between python3.6 and pip. See https://github.com/pypa/pip/issues/10219 for more details.
      
      Testing locally I was able to resolve this particular error by applying https://github.com/pypa/pip/issues/10219#issuecomment-888127061 like this: 
      
      LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 tox
      
      But that resulted in a different error: 
      py36-ansible_syntax create: /test/.tox/py36-ansible_syntax
      py36-ansible_syntax installdeps: -rrequirements.txt, -rtest-requirements.txt
      py36-ansible_syntax installed: ansible==2.9.27,astroid==2.3.3,attrs==21.4.0,cffi==1.15.0,cryptography==36.0.1,entrypoints==0.3,flake8==3.7.9,flake8-mutable==1.2.0,flake8-print==3.1.4,importlib-metadata==4.8.3,isort==4.3.21,Jinja2==3.0.3,lazy-object-proxy==1.4.3,MarkupSafe==2.0.1,mccabe==0.6.1,more-itertools==8.12.0,packaging==21.3,pathspec==0.9.0,pluggy==0.13.1,py==1.11.0,pycodestyle==2.5.0,pycparser==2.21,pyflakes==2.1.1,pylint==2.4.4,pyparsing==3.0.6,pytest==5.4.1,PyYAML==6.0,setuptools-lint==0.6.0,six==1.16.0,typed-ast==1.4.3,typing-extensions==4.0.1,wcwidth==0.2.5,wrapt==1.11.2,yamllint==1.20.0,zipp==3.6.0
      py36-ansible_syntax run-test-pre: PYTHONHASHSEED='1598049278'
      py36-ansible_syntax run-test: commands[0] | python setup.py ansible_syntax
      /test/.tox/py36-ansible_syntax/bin/python: can't open file 'setup.py': [Errno 2] No such file or directory
      ERROR: InvocationError for command /test/.tox/py36-ansible_syntax/bin/python setup.py ansible_syntax (exited with code 2)
      
      This seems similar to the issue fixed here: https://github.com/openshift/openshift-ansible/pull/12355
      
      Also note we have issues https://issues.redhat.com/browse/CORS-1532 and https://issues.redhat.com/browse/CORS-1712 for migrating from the Centos:7 image, and would potentially allow us to use a newer version of python than 3.6 which is soon EOL. 3.7+ do not have this first issue.

      Version-Release number of selected component (if applicable):

       

      How reproducible:

       

      Steps to Reproduce:

      1.
      2.
      3.
      

      Actual results:

       

      Expected results:

       

      Additional info:

       

       

              rh-ee-bbarbach Brent Barbachem
              rh-ee-bbarbach Brent Barbachem
              Gaoyun Pei Gaoyun Pei
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: