]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
remove suite name changes
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Oct 2025 13:21:16 +0000 (09:21 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Oct 2025 16:47:35 +0000 (12:47 -0400)
the junit plugin doesnt need suites to have distinct names.
it is actually merging correctly, the reason for lots of noise
is that the different suites have lots of skips for the
"backend" marked suites.   will fix this in pytestplugin

Change-Id: I4b73de0fbaca6840111d516565421e902c218f5d

noxfile.py
pyproject.toml
tools/toxnox.py

index 06caee3356aab9a983b4add1c6a841bfb232f4da..7ce6a609f1fd0097f7acff8d1685b96764976835 100644 (file)
@@ -12,9 +12,9 @@ from packaging.version import parse as parse_version
 
 if True:
     sys.path.insert(0, ".")
-    from tools.toxnox import move_junit_file
     from tools.toxnox import tox_parameters
     from tools.toxnox import extract_opts
+    from tools.toxnox import OUR_PYTHON
 
 
 SQLA_REPO = os.environ.get(
@@ -59,31 +59,16 @@ def filter_sqla(
     [PYTHON_VERSIONS, SQLALCHEMY_VERSIONS, DATABASES],
     filter_=filter_sqla,
 )
-def tests(session: nox.Session, sqlalchemy: str, database: str) -> None:
+def tests(
+    session: nox.Session, python: str, sqlalchemy: str, database: str
+) -> None:
     """Run the main test suite against one database at a time"""
 
-    _tests(session, sqlalchemy, [database])
-
-
-@nox.session()
-@tox_parameters(
-    ["python", "sqlalchemy"],
-    [PYTHON_VERSIONS, SQLALCHEMY_VERSIONS],
-    filter_=filter_sqla,
-    base_tag="all",
-)
-def tests_alldb(session: nox.Session, sqlalchemy: str) -> None:
-    """Run the main test suite against all backends at once"""
-
-    _tests(session, sqlalchemy, DATABASES)
+    _tests(session, sqlalchemy, [database], python=python)
 
 
 @nox.session(name="coverage")
-@tox_parameters(
-    ["database"],
-    [DATABASES],
-    base_tag="coverage",
-)
+@tox_parameters(["database"], [DATABASES], base_tag="coverage")
 def coverage(session: nox.Session, database: str) -> None:
     """Run tests with coverage."""
 
@@ -94,6 +79,8 @@ def _tests(
     session: nox.Session,
     sqlalchemy: str,
     databases: Sequence[str],
+    *,
+    python: str = OUR_PYTHON,
     coverage: bool = False,
 ) -> None:
     if sqlalchemy == "sqla14":
@@ -170,29 +157,20 @@ def _tests(
     posargs, opts = extract_opts(session.posargs, "generate-junit")
 
     if opts.generate_junit:
-        cmd.extend(["--junitxml", "junit-tmp.xml"])
+        # produce individual junit files that are per-database (or as close
+        # as we can get).  jenkins junit plugin will merge all the files...
+        if len(databases) == 1:
+            tag = "-".join(databases)
+            junitfile = f"junit-{tag}.xml"
+        else:
+            junitfile = "junit-general.xml"
+        cmd.extend(["--junitxml", junitfile])
 
     cmd.extend(posargs)
 
     try:
         session.run(*cmd)
     finally:
-        # name the suites distinctly as well.   this is so that when they get
-        # merged we can view each suite distinctly rather than them getting
-        # overwritten with each other since they are running the same tests
-        if opts.generate_junit:
-            # produce individual junit files that are per-database (or as close
-            # as we can get).  jenkins junit plugin will merge all the files...
-            if len(databases) == 1:
-                tag = "-".join(databases)
-                junitfile = f"junit-{tag}.xml"
-                suite_name = f"pytest-{tag}"
-            else:
-                junitfile = "junit-general.xml"
-                suite_name = "pytest-general"
-
-            move_junit_file("junit-tmp.xml", junitfile, suite_name)
-
         # Run cleanup for oracle/mssql
         for database in databases:
             if database in ["oracle", "mssql"]:
index a05d5aee6d603764563fd83510b09dd68d4eda18..3b9bed6c9778d146b1d82f65c2c07049388d5479 100644 (file)
@@ -66,7 +66,7 @@ coverage = [
 
 tests_postgresql = ["psycopg2>=2.7"]
 tests_mysql = ["mysqlclient>=1.4.0", "pymysql"]
-tests_oracle = ["cx_oracle", "oracledb"]
+tests_oracle = ["cx_oracle"]
 tests_mssql = ["pyodbc"]
 
 lint = [
index b64b71a7c3b380a7b666045081f34a7b03e31213..497a689c613fb3a70c0c73d7776133053439c656 100644 (file)
@@ -11,7 +11,6 @@ would fall back to defaults.
 from __future__ import annotations
 
 import collections
-import os
 import re
 import sys
 from typing import Any
@@ -216,13 +215,3 @@ def extract_opts(posargs: List[str], *args: str) -> Tuple[List[str], Any]:
     return [arg for arg in posargs if not extract(arg)], return_tuple(
         *return_args
     )
-
-
-def move_junit_file(tmpfilename: str, newname: str, suite_name: str):
-    import junitparser
-
-    xml = junitparser.JUnitXml.fromfile(tmpfilename)
-    for suite in xml:
-        suite.name = suite_name
-    xml.write(newname)
-    os.unlink(tmpfilename)