← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2043141] Re: neutron-lib unit tests need update for sqlalchemy 2.0

 

Reviewed:  https://review.opendev.org/c/openstack/neutron-lib/+/900557
Committed: https://opendev.org/openstack/neutron-lib/commit/825d292c972e1a0478ce965603fed8f9114ee211
Submitter: "Zuul (22348)"
Branch:    master

commit 825d292c972e1a0478ce965603fed8f9114ee211
Author: Brian Haley <haleyb.dev@xxxxxxxxx>
Date:   Thu Nov 9 15:49:23 2023 -0500

    Change test_sqlalchemytypes.py to support sqlalchemy 2.0
    
    With the move to sqlalchemy 2.0 some of the API methods
    have changed, but these tests were never updated.
    
    Also added an sqlalchemy-master job so we do not regress.
    
    Depends-on: https://review.opendev.org/c/openstack/requirements/+/900517
    Closes-bug: #2043141
    
    Change-Id: I9e1c796dcda725844ea6b7a0d5c8a8c11560b2b3


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

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

Title:
  neutron-lib unit tests need update for sqlalchemy 2.0

Status in neutron:
  Fix Released

Bug description:
  Some of the neutron-lib unit tests do not support sqlalchemy 2.0.

  Thomas Goirand ran them on a Debian system and this test file fails:

    neutron_lib/tests/unit/db/test_sqlalchemytypes.py

  There are 8 failures, all basically the same:

  105s FAIL: neutron_lib.tests.unit.db.test_sqlalchemytypes.CIDRTestCase.test_crud
  105s neutron_lib.tests.unit.db.test_sqlalchemytypes.CIDRTestCase.test_crud
  105s ----------------------------------------------------------------------
  105s testtools.testresult.real._StringException: Traceback (most recent call last):
  105s   File "/tmp/autopkgtest-lxc.jvth6_27/downtmp/build.pBL/src/neutron_lib/tests/unit/db/test_sqlalchemytypes.py", line 36, in setUp
  105s     meta = sa.MetaData(bind=self.engine)
  105s            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  105s TypeError: MetaData.__init__() got an unexpected keyword argument 'bind'

  From looking at the functional tests and Nova code, should be a
  straightforward fix.

  We should also look at creating a test job that both tests sqlalchemy
  2.0 and neutron-lib main/master branches so we don't regress.

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



References