neutron-lib unit tests need update for sqlalchemy 2.0

Bug #2043141 reported by Brian Haley
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Brian Haley

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.

Tags: unittest
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lib (master)
Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lib (master)

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 <email address hidden>
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-lib 3.9.0

This issue was fixed in the openstack/neutron-lib 3.9.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.