Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8ed8122
feat: parallelize testsuite tests with database pooling for CI
vistart Aug 18, 2026
7e61c6f
ci: use -n 8 parallelism for server-type tests
vistart Aug 18, 2026
463ae07
fix(test): check for simultaneous double-hold instead of id uniqueness
vistart Aug 18, 2026
725117f
feat: CLI async unification, --ssl param; sqlserver fixes (user/usern…
vistart Aug 18, 2026
2344f62
fix(test): pass --driver from scenario config in sqlserver blackbox c…
vistart Aug 19, 2026
3901a9c
feat(sqlserver): add named CLI examples and fix named-procedure CLI a…
vistart Aug 19, 2026
f97496c
test(expression): add serialization round-trip coverage for SQL Serve…
vistart Aug 24, 2026
ea2fe0e
test: add is_auto_increment/DDL regression tests
vistart Aug 25, 2026
46b4160
feat(dialect): declare supports_schema; add cross-schema provider fix…
vistart Aug 26, 2026
99f1641
test(provider): provision mixed default/non-default schema fixtures
vistart Aug 26, 2026
a3e2984
ci(test): merge xdist coverage via pytest-cov; restore codecov fidelity
vistart Aug 26, 2026
f8e87de
test(backend): adapter suggestion cache behavior without a live server
vistart Aug 26, 2026
599b39c
test(sqlserver): CLI black-box suites, adapters and dialect version-g…
vistart Aug 26, 2026
4c85889
fix(adapters): module-level ET import and WKT point separators
vistart Aug 26, 2026
87dd81b
fix(cli): honour encrypt/trust flags with defined precedence over --ssl
vistart Aug 26, 2026
bd29f6e
fix(adapters): date adapter branch ordering
vistart Aug 26, 2026
a108702
docs(cli): clarify statement input forms
vistart Aug 26, 2026
5076585
fix(backend): remove %s->? placeholder guessing at execute layer
vistart Aug 27, 2026
13df8c3
test: use native '?' placeholders in remaining SQL Server tests
vistart Aug 27, 2026
215d42d
fix(introspection): parameterize SQL Server introspector SQL and hard…
vistart Aug 27, 2026
7a1017f
test: add SET whitelist and identifier quoting balance tests
vistart Aug 27, 2026
7c39f4d
test: fix SQL Server whitelist and bracket-balance security tests
vistart Aug 27, 2026
b29bb0f
test: fix SQL Server security test dateformat casing and bracket-skip…
vistart Aug 27, 2026
9332962
fix(sqlserver): delegate set_deadlock_priority to backend whitelist v…
vistart Aug 27, 2026
5340619
ci: update testsuite branch to release/v1.0.0.dev17
vistart Aug 28, 2026
70abb33
ci: update rhosocial-activerecord branch to release/v1.0.0.dev30
vistart Aug 28, 2026
cbd6064
ci: update testsuite branch to release/v1.0.0.dev17
vistart Aug 28, 2026
c70a1e9
test: add targeted coverage for low-coverage patch areas
vistart Aug 29, 2026
cc3fbf5
chore: add changelog fragment for PR #2
vistart Aug 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 29 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- main
- "release/v**"
- "maint/**"
workflow_dispatch:

permissions:
contents: read
Expand Down Expand Up @@ -58,8 +59,8 @@

- name: Install activerecord and testsuite from PyPI
run: |
pip install rhosocial-activerecord==1.0.0.dev29
pip install rhosocial-activerecord-testsuite==1.0.0.dev16
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"

Check warning on line 62 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5ZZ&open=AaBLFYCPAFZemf58g5ZZ&pullRequest=2
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

Check warning on line 63 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zb&open=AaBLFYCPAFZemf58g5Zb&pullRequest=2

- name: Create test database
run: |
Expand Down Expand Up @@ -104,7 +105,7 @@
- name: Run tests
run: |
export PYTHONPATH=src:tests
python -m pytest tests/
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x

test-py39-sqlserver2017:
name: Run tests with Python 3.9 and SQL Server 2017
Expand Down Expand Up @@ -147,8 +148,8 @@

- name: Install activerecord and testsuite from PyPI
run: |
pip install rhosocial-activerecord==1.0.0.dev29
pip install rhosocial-activerecord-testsuite==1.0.0.dev16
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

Check warning on line 152 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Ze&open=AaBLFYCPAFZemf58g5Ze&pullRequest=2

Check warning on line 152 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zd&open=AaBLFYCPAFZemf58g5Zd&pullRequest=2

- name: Create test database
run: |
Expand Down Expand Up @@ -193,7 +194,7 @@
- name: Run tests
run: |
export PYTHONPATH=src:tests
python -m pytest tests/
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x

test-py310-sqlserver2019:
name: Run tests with Python 3.10 and SQL Server 2019
Expand Down Expand Up @@ -236,8 +237,8 @@

- name: Install activerecord and testsuite from PyPI
run: |
pip install rhosocial-activerecord==1.0.0.dev29
pip install rhosocial-activerecord-testsuite==1.0.0.dev16
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"

Check warning on line 240 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zf&open=AaBLFYCPAFZemf58g5Zf&pullRequest=2
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

Check warning on line 241 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zg&open=AaBLFYCPAFZemf58g5Zg&pullRequest=2

- name: Create test database
run: |
Expand Down Expand Up @@ -282,7 +283,7 @@
- name: Run tests
run: |
export PYTHONPATH=src:tests
python -m pytest tests/
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x

test-py311-sqlserver2019:
name: Run tests with Python 3.11 and SQL Server 2019
Expand Down Expand Up @@ -325,8 +326,8 @@

- name: Install activerecord and testsuite from PyPI
run: |
pip install rhosocial-activerecord==1.0.0.dev29
pip install rhosocial-activerecord-testsuite==1.0.0.dev16
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"

Check warning on line 329 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zi&open=AaBLFYCPAFZemf58g5Zi&pullRequest=2
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

Check warning on line 330 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zj&open=AaBLFYCPAFZemf58g5Zj&pullRequest=2

Check warning on line 330 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zk&open=AaBLFYCPAFZemf58g5Zk&pullRequest=2

- name: Create test database
run: |
Expand Down Expand Up @@ -371,7 +372,7 @@
- name: Run tests
run: |
export PYTHONPATH=src:tests
python -m pytest tests/
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x

test-py312-sqlserver2025:
name: Run tests with Python 3.12 and SQL Server 2025
Expand Down Expand Up @@ -414,8 +415,8 @@

- name: Install activerecord and testsuite from PyPI
run: |
pip install rhosocial-activerecord==1.0.0.dev29
pip install rhosocial-activerecord-testsuite==1.0.0.dev16
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"

Check warning on line 418 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zl&open=AaBLFYCPAFZemf58g5Zl&pullRequest=2
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

Check warning on line 419 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zn&open=AaBLFYCPAFZemf58g5Zn&pullRequest=2

Check warning on line 419 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zm&open=AaBLFYCPAFZemf58g5Zm&pullRequest=2

- name: Create test database
run: |
Expand Down Expand Up @@ -460,7 +461,7 @@
- name: Run tests
run: |
export PYTHONPATH=src:tests
python -m pytest tests/
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x

test-py313-sqlserver2022:
name: Run tests with Python 3.13 and SQL Server 2022
Expand Down Expand Up @@ -503,8 +504,8 @@

- name: Install activerecord and testsuite from PyPI
run: |
pip install rhosocial-activerecord==1.0.0.dev29
pip install rhosocial-activerecord-testsuite==1.0.0.dev16
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"

Check warning on line 507 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zo&open=AaBLFYCPAFZemf58g5Zo&pullRequest=2
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

- name: Create test database
run: |
Expand Down Expand Up @@ -549,7 +550,7 @@
- name: Run tests
run: |
export PYTHONPATH=src:tests
python -m pytest tests/
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x

test-py313t-sqlserver2019:
name: Run tests with Python 3.13t (free-threaded) and SQL Server 2019
Expand Down Expand Up @@ -593,8 +594,8 @@

- name: Install activerecord and testsuite from PyPI
run: |
pip install rhosocial-activerecord==1.0.0.dev29
pip install rhosocial-activerecord-testsuite==1.0.0.dev16
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"

Check warning on line 597 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zr&open=AaBLFYCPAFZemf58g5Zr&pullRequest=2
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

Check warning on line 598 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zt&open=AaBLFYCPAFZemf58g5Zt&pullRequest=2

- name: Create test database
run: |
Expand Down Expand Up @@ -639,7 +640,7 @@
- name: Run tests
run: |
export PYTHONPATH=src:tests
python -m pytest tests/
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x

test-py314-sqlserver2025:
name: Run tests with Python 3.14 and SQL Server 2025
Expand Down Expand Up @@ -682,8 +683,8 @@

- name: Install activerecord and testsuite from PyPI
run: |
pip install rhosocial-activerecord==1.0.0.dev29
pip install rhosocial-activerecord-testsuite==1.0.0.dev16
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"

Check warning on line 686 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zu&open=AaBLFYCPAFZemf58g5Zu&pullRequest=2
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

Check warning on line 687 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zv&open=AaBLFYCPAFZemf58g5Zv&pullRequest=2

Check warning on line 687 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zw&open=AaBLFYCPAFZemf58g5Zw&pullRequest=2

- name: Create test database
run: |
Expand Down Expand Up @@ -728,9 +729,7 @@
- name: Run tests with coverage
run: |
export PYTHONPATH=src:tests
pip install coverage
coverage run --source=src -m pytest tests/ --tb=short
coverage xml
python -m pytest tests/ --tb=short -n 8 --dist=loadgroup --cov=src/rhosocial --cov-branch --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
Expand All @@ -739,7 +738,7 @@
files: ./coverage.xml
flags: unittests,python-3.14,sqlserver-2025
name: codecov-sqlserver-3.14-2025
fail_ci_if_error: false
fail_ci_if_error: true

test-py314t-sqlserver2022:
name: Run tests with Python 3.14t (free-threaded) and SQL Server 2022
Expand Down Expand Up @@ -782,8 +781,8 @@

- name: Install activerecord and testsuite from PyPI
run: |
pip install rhosocial-activerecord==1.0.0.dev29
pip install rhosocial-activerecord-testsuite==1.0.0.dev16
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30"

Check warning on line 784 in .github/workflows/test.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--only-binary :all:" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=rhosocial_python-activerecord-sqlserver&issues=AaBLFYCPAFZemf58g5Zx&open=AaBLFYCPAFZemf58g5Zx&pullRequest=2
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17"

- name: Create test database
run: |
Expand Down Expand Up @@ -828,4 +827,4 @@
- name: Run tests
run: |
export PYTHONPATH=src:tests
python -m pytest tests/
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x
1 change: 1 addition & 0 deletions changelog.d/2.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add parallel testing infrastructure and SQL Server backend improvements
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespaces = true

[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-ra -q"
addopts = "-ra -q -p rhosocial.activerecord.testsuite.conftest"
asyncio_mode = "auto"
testpaths = [
"tests",
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
addopts = -v --tb=short
addopts = -v --tb=short -p rhosocial.activerecord.testsuite.conftest
filterwarnings =
ignore::DeprecationWarning
markers =
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ pytest
pytest-asyncio
pytest-cov
pytest-benchmark
pytest-xdist
coverage>=7.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ def _build_parser():
return parser


def parse_args():
def parse_args(argv=None):
"""Parse command-line arguments.

Provided for test compatibility. In production, main() is used instead.
"""
parser = _build_parser()
return parser.parse_args()
return parser.parse_args(argv)


def main():
def main(argv=None):
parser = _build_parser()
args = parser.parse_args()
args = parser.parse_args(argv)

if args.command is None:
cmd_list = ", ".join(f"'{c}'" for c in COMMAND_NAMES[:-1])
Expand Down
17 changes: 9 additions & 8 deletions src/rhosocial/activerecord/backend/impl/sqlserver/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import json
import uuid
import xml.etree.ElementTree as ET
from abc import ABC, abstractmethod
from datetime import date, datetime, time, timezone
from typing import Any, Dict, List, Type, Union
Expand Down Expand Up @@ -203,19 +204,21 @@ def supported_types(self) -> Dict[Type, List[str]]:
def to_database(self, value: Any, target_type: Type = None, options: Dict = None) -> Any:
if value is None:
return None
if isinstance(value, date):
return value
# datetime is an isinstance of date, so it must be checked first
# to truncate to the date component.
if isinstance(value, datetime):
return value.date()
if isinstance(value, date):
return value
raise TypeError(f"Expected date, got {type(value)}")

def from_database(self, value: Any, target_type: Type = None, options: Dict = None) -> date:
if value is None:
return None
if isinstance(value, date):
return value
if isinstance(value, datetime):
return value.date()
if isinstance(value, date):
return value
if isinstance(value, str):
return date.fromisoformat(value)
raise TypeError(f"Cannot convert {type(value)} to date")
Expand Down Expand Up @@ -335,8 +338,6 @@ def from_database(self, value: Any, target_type: Type = None, options: Dict = No
raise TypeError(f"Cannot convert {type(value)} to XML")

def _dict_to_xml(self, data: dict, root: str = "root") -> str:
import xml.etree.ElementTree as ET

root_elem = ET.Element(root)
self._build_xml(root_elem, data)
return ET.tostring(root_elem, encoding='unicode')
Expand Down Expand Up @@ -411,14 +412,14 @@ def _dict_to_wkt(self, data: dict) -> str:

elif geom_type == 'LineString':
coords = data.get('coordinates', [])
points = " ".join(f"{c[0]} {c[1]}" for c in coords)
points = ", ".join(f"{c[0]} {c[1]}" for c in coords)
return f"LINESTRING({points})"

elif geom_type == 'Polygon':
coords = data.get('coordinates', [[]])
rings = []
for ring in coords:
points = " ".join(f"{c[0]} {c[1]}" for c in ring)
points = ", ".join(f"{c[0]} {c[1]}" for c in ring)
rings.append(f"({points})")
return f"POLYGON({','.join(rings)})"

Expand Down
Loading
Loading