← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1852356] Re: tox testenv not installing requirements properly

 

Reviewed:  https://review.opendev.org/693951
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=d2d67ae3a1e7f4e482adf6b2e050f81cf57ec9e7
Submitter: Zuul
Branch:    master

commit d2d67ae3a1e7f4e482adf6b2e050f81cf57ec9e7
Author: Brian Rosmaita <rosmaita.fossdev@xxxxxxxxx>
Date:   Tue Nov 12 19:30:46 2019 -0500

    Install requirements during the correct tox phase
    
    Glance isn't explicitly installing requirements, so add requirements
    as tox deps in such a way that they'll be properly constrained by the
    current openstack upper-constraints.
    
    This change also bumps the version of psycopg to that of the current
    upper-constraints in test-requirements and lower-constraints.  (The
    version in our current lower-constraints is subject to the "could not
    determine PostgreSQL version from '10.x'" error, which causes the
    lower-constraints job to fail.)
    
    Change-Id: I1bb5759e6b1e3f8545ab417617072a61323b59a7
    Closes-bug: #1852356


** Changed in: glance
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1852356

Title:
  tox testenv not installing requirements properly

Status in Glance:
  Fix Released

Bug description:
  I've encountered this recently when building new tox environments:

  =========================
  Failures during discovery
  =========================
  --- import errors ---
  Failed to import test module: glance.tests.unit.api.test_cmd
  Traceback (most recent call last):
    File "/home/brosmait/repos/openstack/glance/.tox/py36/lib/python3.6/site-packages/unittest2/loader.py", line 456, in _find_test_path
      module = self._get_module_from_name(name)
    File "/home/brosmait/repos/openstack/glance/.tox/py36/lib/python3.6/site-packages/unittest2/loader.py", line 395, in _get_module_from_name
      __import__(name)
    File "/home/brosmait/repos/openstack/glance/glance/tests/unit/api/test_cmd.py", line 20, in <module>
      import glance.cmd.api
    File "/home/brosmait/repos/openstack/glance/glance/cmd/api.py", line 42, in <module>
      from oslo_reports import guru_meditation_report as gmr
  ModuleNotFoundError: No module named 'oslo_reports'

  
  Looking at the current tox.ini, the base testenv sets some env vars and then we have:
  install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
  deps = -r{toxinidir}/test-requirements.txt

  No mention of the requirements at all.

  I think we are hitting a bug that Tony Breeds patched in Cinder,
  Change-Id: I5b1c285680f7c3256a707ea5973573f1176d4a26

  Change the testenv like this:

  install_command = pip install {opts} {packages}

  deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
         -r{toxinidir}/test-requirements.txt
         -r{toxinidir}/requirements.txt

  This makes sure that the u-c file is applied to both the test-req and
  the requirements, which is what we want.

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1852356/+subscriptions


References