From 8d2e93f30c90294c0f9ca97c6b0c9baa2f79bbf9 Mon Sep 17 00:00:00 2001
From: Stephen Finucane <sfinucan@redhat.com>
Date: Tue, 13 Jun 2023 11:57:50 -0700
Subject: [PATCH] Add job to test with SQLAlchemy master (2.x)

Change-Id: I75c021b02187ee0b746c49eb545b79b3a40608b1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
---
 zuul.d/ironic-jobs.yaml | 18 ++++++++++++++++++
 zuul.d/project.yaml     |  2 ++
 2 files changed, 20 insertions(+)

diff --git a/zuul.d/ironic-jobs.yaml b/zuul.d/ironic-jobs.yaml
index f084e8ddcb..1ef20f37d0 100644
--- a/zuul.d/ironic-jobs.yaml
+++ b/zuul.d/ironic-jobs.yaml
@@ -686,6 +686,24 @@
     vars:
       tox_envlist: unit-with-driver-libs
 
+# TODO(stephenfin): Remove this when we raise the upper-constraint globally
+- job:
+    name: ironic-tox-unit-with-sqlalchemy-2x
+    parent: openstack-tox
+    description: |
+      Run unit tests with main branch of SQLAlchemy, alembic and oslo.db.
+      Takes advantage of the base tox job's install-siblings feature.
+    vars:
+      tox_envlist: py3
+    # The job only tests the latest and shouldn't be run on the stable branches
+    branches: ^(?!stable)
+    required-projects:
+      - name: github.com/sqlalchemy/sqlalchemy
+        override-checkout: main
+      - name: github.com/sqlalchemy/alembic
+        override-checkout: main
+      - name: openstack/oslo.db
+
 - job:
     name: ironic-tox-unit-mysql-migrations
     parent: openstack-tox
diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml
index 4009f4f605..8644a6dfc7 100644
--- a/zuul.d/project.yaml
+++ b/zuul.d/project.yaml
@@ -10,6 +10,7 @@
     check:
       jobs:
         - ironic-tox-unit-mysql-migrations
+        - ironic-tox-unit-with-sqlalchemy-2x
         - ironic-tox-unit-with-driver-libs
         - ironic-cross-sushy:
             voting: false
@@ -67,6 +68,7 @@
     gate:
       jobs:
         - ironic-tox-unit-mysql-migrations
+        - ironic-tox-unit-with-sqlalchemy-2x
         - ironic-tox-unit-with-driver-libs
         - ironic-tempest-functional-python3
         # NOTE(rpittau) disabled until we fix the tests