Merge "Add job to test with SQLAlchemy master (2.x)"

This commit is contained in:
Zuul 2024-04-11 18:54:01 +00:00 committed by Gerrit Code Review
commit d8987589ae
2 changed files with 47 additions and 5 deletions

View File

@ -1997,13 +1997,37 @@ class ShareSnapshotDatabaseAPITestCase(test.TestCase):
def test_share_snapshot_instance_access_get_all(self): def test_share_snapshot_instance_access_get_all(self):
access = db_utils.create_snapshot_access( access = db_utils.create_snapshot_access(
share_snapshot_id=self.snapshot_1['id']) share_snapshot_id=self.snapshot_1['id'])
values = {'share_snapshot_instance_id': self.snapshot_instances[0].id,
'access_id': access['id']}
rules = db_api.share_snapshot_instance_access_get_all( # NOTE(zzzeek) the create_snapshot_access routine iterates through the
self.ctxt, access['id']) # ShareSnapshot.instances collection and creates a new
# ShareSnapshotInstanceAccessMapping for each ShareSnapshotInstance.
# however, this collection is unordered and does not have any guarantee
# that its ordering would match that of our self.snapshot_instances
# collection. Therefore key the fixture values and the resulting
# ShareSnapshotInstanceAccessMapping objects by share_snapshot_id
# and compare individually.
self.assertSubDictMatch(values, rules[0].to_dict()) values_by_sid = {
snapshot_instance.id: {
'share_snapshot_instance_id': snapshot_instance.id,
'access_id': access['id']
}
for snapshot_instance in self.snapshot_instances
if "fake" not in snapshot_instance.id
}
rules_by_sid = {
rule.share_snapshot_instance_id: rule
for rule in db_api.share_snapshot_instance_access_get_all(
self.ctxt, access['id']
)
}
for sid in values_by_sid:
self.assertSubDictMatch(
values_by_sid[sid],
rules_by_sid[sid].to_dict()
)
def test_share_snapshot_access_get(self): def test_share_snapshot_access_get(self):
access = db_utils.create_snapshot_access( access = db_utils.create_snapshot_access(

View File

@ -10,6 +10,7 @@
queue: manila queue: manila
check: check:
jobs: jobs:
- manila-tox-py311-with-sqlalchemy-2x
- manila-tox-genconfig - manila-tox-genconfig
- openstack-tox-pylint: - openstack-tox-pylint:
voting: false voting: false
@ -30,9 +31,26 @@
voting: false voting: false
gate: gate:
jobs: jobs:
- manila-tox-py311-with-sqlalchemy-2x
- manila-tempest-plugin-dummy-no-dhss - manila-tempest-plugin-dummy-no-dhss
- manila-tempest-plugin-dummy-dhss - manila-tempest-plugin-dummy-dhss
# Temporary job until SQLAlchemy 2.0 is no longer blocked by upper-requirements
- job:
name: manila-tox-py311-with-sqlalchemy-2x
parent: openstack-tox-py311
description: |
Run unit tests with main branch of SQLAlchemy, alembic and oslo.db.
Takes advantage of the base tox job's install-siblings feature.
# The job only tests the latest and shouldn't be run on the stable branches
branches: master
required-projects:
- name: github.com/sqlalchemy/sqlalchemy
override-checkout: main
- name: github.com/sqlalchemy/alembic
override-checkout: main
- name: openstack/oslo.db
- job: - job:
name: manila-tox-genconfig name: manila-tox-genconfig
parent: openstack-tox parent: openstack-tox