You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f25368f
Browse filesBrowse the repository at this point in the historyBrowse files
feat: parallel testing infrastructure and SQL Server backend improvements (#2)
* feat: parallelize testsuite tests with database pooling for CI
- wire the testsuite database pool and pooling providers so scenario tests
run in parallel (pytest-xdist -n auto) against per-worker pooled
databases instead of the shared scenario database
- reset handler skips DROP/CREATE DATABASE when the slot is already clean
- enable READ_COMMITTED_SNAPSHOT on pooled databases to avoid deadlock-
induced rollback failures in concurrent transaction tests
- install activerecord and testsuite from feature/parallel-testing in CI
* ci: use -n 8 parallelism for server-type tests
* fix(test): check for simultaneous double-hold instead of id uniqueness
* feat: CLI async unification, --ssl param; sqlserver fixes (user/username unification, RICH_AVAILABLE removal, disconnect_async guard)
* fix(test): pass --driver from scenario config in sqlserver blackbox conn_args
The sqlserver CLI defaults --driver to ODBC Driver 18 for SQL Server, but CI
runners only install ODBC Driver 17. The blackbox conn_args did not forward
the scenario driver, so query/status/async tests failed with missing ODBC
Driver 18. Forward config.driver via --driver so the correct installed
driver is used.
* feat(sqlserver): add named CLI examples and fix named-procedure CLI adapter
- Fix cli/named_procedure.py adapter: remove invalid get_dialect/execute_query
kwargs and ExecutionOptions import (core handle_named_procedure rejects them)
- Add named_connections examples (development/production) with 6 connections
- Add named_expressions order_expressions (import-safe, prepare_orders_demo helper)
- Add named_procedures order_workflow (OrderProcessingProcedure, max_concurrency=1
for pyodbc single-connection concurrency limit)
- Add cli demo scripts: named_connection_demo, named_query_demo, named_procedure_demo
- Update examples README with new directories
* test(expression): add serialization round-trip coverage for SQL Server expressions
* test: add is_auto_increment/DDL regression tests
Dialect-level tests (no DB needed) verifying:
1. is_auto_increment=True produces correct auto-increment DDL keyword
2. All standard types (Integer/Text/Boolean/VarChar/Timestamp) compile
3. BooleanType + DEFAULT True is accepted
4. TimestampType maps to correct backend-specific type
Prevents recurrence of bugs found in rbac cross-backend testing.
* feat(dialect): declare supports_schema; add cross-schema provider fixtures
* test(provider): provision mixed default/non-default schema fixtures
* ci(test): merge xdist coverage via pytest-cov; restore codecov fidelity
The single uploading job ran coverage run under pytest-xdist without a
combine step (59.49% -> 26.46%). Move to pytest-cov reporting and fail on
upload errors. Investigation plan recorded locally under .claude/plan/2026-08-26.
* test(backend): adapter suggestion cache behavior without a live server
Locks the registered-type set (datetime/date/time/Decimal/UUID/dict/list)
and documents that primitives intentionally rely on default binding;
addresses the backend_mixin gap from the coverage plan.
* test(sqlserver): CLI black-box suites, adapters and dialect version-grid units
238 cases across the four CLI entrypoints (parser contracts, fake-backend
handle() outputs, error exits), 10 adapters bidirectional round-trips, and
a SQL Server version grid for pagination/capability/temp-table/hint/MERGE
rendering. Defects (XML dict adapter NameError, WKT commas, date-adapter
dead branch) recorded in test comments only.
* fix(adapters): module-level ET import and WKT point separators
S1: hoist 'import xml.etree.ElementTree as ET' to module scope so
SQLServerXMLAdapter dict rendering works instead of raising NameError.
S2: _dict_to_wkt now separates coordinate pairs with commas
(LINESTRING(1 2, 3 4), POLYGON((0 0, 0 1, 1 1, 0 0))) producing valid WKT.
Anchor flip: NameError-pinning XML test replaced with positive round-trip
assertions (text/nested/repeated nodes); LineString/Polygon expectations
updated to comma-separated WKT.
* fix(cli): honour encrypt/trust flags with defined precedence over --ssl
S4: resolve_connection_config_from_args now reads --encrypt/--no-encrypt
and --trust-server-certificate/--no-trust-server-certificate. Flags use a
None sentinel default so explicit usage is detectable; explicit flags take
precedence over --ssl derivation. The default --ssl auto no longer implies
encrypt=True. Default matrix documented in the module docstring.
Anchor flip: parser-contract tests assert None sentinel defaults; SSL
mapping rewritten as a full five-mode matrix plus flag-combination
precedence cases.
* fix(adapters): date adapter branch ordering
S3: SQLServerDateAdapter checks datetime before date (datetime is an
isinstance of date) so to_database/from_database truncate datetimes to
their date component; the value.date() branches are no longer dead code.
Anchor flip: dead-branch pinning test replaced with datetime->date
truncation assertions in both directions plus a date-only passthrough case.
* docs(cli): clarify statement input forms
S6: query --help epilog now states the three statement input forms
(positional argument, -f/--file, stdin pipe) and that no -q short option
exists by design. Documentation only; no behaviour change.
* fix(backend): remove %s->? placeholder guessing at execute layer
Unify placeholder handling per the get_parameter_placeholder() contract:
callers provide native '?' markers and _prepare_sql_and_params only performs
the SQL Server-specific table hint relocation. Update CRUD tests to use '?'.
* test: use native '?' placeholders in remaining SQL Server tests
Completes the placeholder unification contract: all remaining raw SQL in
tests (transaction isolation, connection pool) switches from MySQL-style
'%s' to SQL Server native '?' markers.
* fix(introspection): parameterize SQL Server introspector SQL and harden SET statements
- Convert all 7 _build_*_sql methods in the SQL Server introspector from
f-string identifier interpolation to '?' placeholders, returning (sql,
params) tuples consistent with the base IntrospectorMixin contract.
- _build_primary_key_sql now returns (sql, params); update sync/async
list_columns callers to pass params to executor.execute.
- IDENT_CURRENT and DBCC CHECKIDENT now take table/seed as bound
parameters instead of raw string embedding.
- Add whitelist validation for SET LANGUAGE, SET DATEFORMAT, and
SET DEADLOCK_PRIORITY (int range -10..10 or LOW/NORMAL/HIGH).
* test: add SET whitelist and identifier quoting balance tests
* test: fix SQL Server whitelist and bracket-balance security tests
Test the actual whitelist constants (_SQLSERVER_LANGUAGES / _DATE_FORMATS /
_DEADLOCK_PRIORITIES) and fix the bracket-balance assertion to correctly
check that every embedded ] is escaped as ]].
* test: fix SQL Server security test dateformat casing and bracket-skip logic
- SET DATEFORMAT validation lowercases input, so mdY is valid; keep only
genuinely invalid formats in the negative case.
- bracket-balance check now actually skips escaped ]] pairs via index skip.
* fix(sqlserver): delegate set_deadlock_priority to backend whitelist validation
Transaction manager's set_deadlock_priority now reuses the backend mixin's
whitelist (-10..10 or LOW/NORMAL/HIGH) instead of bare f-string concat.
* ci: update testsuite branch to release/v1.0.0.dev17
* ci: update rhosocial-activerecord branch to release/v1.0.0.dev30
* ci: update testsuite branch to release/v1.0.0.dev17
* test: add targeted coverage for low-coverage patch areas
- cover backend_mixin validation branches (deadlock priority range/
whitelist, language whitelist, dateformat whitelist) and parameterized
IDENT_CURRENT/CHECKIDENT queries via mocked cursors
- cover introspector parameterized SQL builders (table/column/primary
key/index/foreign key/view/trigger) offline
- cover __main__.parse_args with custom argv
- cover transaction manager set_deadlock_priority backend delegation
* chore: add changelog fragment for PR #2
0 commit comments