Repository navigation
feat: parallel testing infrastructure - #20
Merged
Merged
Conversation
- add parallel-testing plugin: pytest_addoption, serial markers, worker database pinning, dynamic slot acquire/release, session-start slot prep - make clear-on-acquire optional per backend - sanitize lock filename base to support path-based databases
…E support Add @requires_protocol(CTESupport, 'supports_basic_cte') to the error-handling and connection-context test classes in the CTE query feature that construct CTEQuery/AsyncCTEQuery directly, so backends without basic CTE support (MySQL 5.6/5.7) skip them instead of failing inside CTEQuery.__init__. Also teach the query conftest's check_protocol_requirements fixture to resolve models from sync_pool_and_model / async_pool_and_model, which the connection-of CTE context tests rely on.
Move heuristic construction, special-constructor registry, and dict/JSON/XML round-trip assertion helpers into the backend-agnostic testsuite package so core and all database backends reuse one source. - _placeholder_for/_try_construct build instances from __init__ signatures - register_special_constructor/register_all handle validation-heavy classes - assert_params_equal recurses into BaseExpression and dataclass params - roundtrip_expression / sql_consistent verify lossless serialization
…accepted Value-object DataType classes (e.g. MySQLYearType, PostgresBitType) declare no dialect parameter; passing dialect=kwd failed construction. Only inject when the class signature contains 'dialect'.
New feature/query/cross_schema package: two models bound to explicit non-default schemas (ar_crm.customers / ar_shop.orders) joined, counted, written and scoped via ActiveQuery. Tests declare @requires_protocol(SchemaSupport, 'supports_schema') so backends without schema namespaces skip declaratively; provisioning is an optional provider method (setup_schema_fixtures), absent providers skip too.
Mixed-schema fixtures subclass existing fixtures and override __schema_name__, so identical DDL is provisioned in the default namespace and SCHEMA_A. Covers coexistence, namespace-scoped PK lookup, scoped update/delete and cross-schema joins between default users and schema-qualified orders.
- join types: LEFT NULL-row semantics, RIGHT preservation, FULL OUTER, CROSS cartesian, mixed-type chains, STRAIGHT_JOIN equivalence - USING-clause joins incl. mutual-exclusivity with ON - true self-joins via runtime-derived aliased proxies (Node tree) - JOIN x GROUP BY/HAVING aggregation, IN-subquery composition - column-qualifier form contracts (two-part columns under joins, schema ranges without three-part references, alias-only addressing) - fix gating: use testsuite.utils.requires_protocol so the tuple marker is honoured; raw pytest.mark two-arg form silently bypassed skips
|
vistart
added a commit
that referenced
this pull request
Sep 27, 2026
* feat: parallel-testing plugin with database pool and serial mechanism - add parallel-testing plugin: pytest_addoption, serial markers, worker database pinning, dynamic slot acquire/release, session-start slot prep - make clear-on-acquire optional per backend - sanitize lock filename base to support path-based databases * fix(testsuite): gate CTE error-handling and context tests on basic CTE support Add @requires_protocol(CTESupport, 'supports_basic_cte') to the error-handling and connection-context test classes in the CTE query feature that construct CTEQuery/AsyncCTEQuery directly, so backends without basic CTE support (MySQL 5.6/5.7) skip them instead of failing inside CTEQuery.__init__. Also teach the query conftest's check_protocol_requirements fixture to resolve models from sync_pool_and_model / async_pool_and_model, which the connection-of CTE context tests rely on. * feat(testsuite): add shared expression round-trip test utilities Move heuristic construction, special-constructor registry, and dict/JSON/XML round-trip assertion helpers into the backend-agnostic testsuite package so core and all database backends reuse one source. - _placeholder_for/_try_construct build instances from __init__ signatures - register_special_constructor/register_all handle validation-heavy classes - assert_params_equal recurses into BaseExpression and dataclass params - roundtrip_expression / sql_consistent verify lossless serialization * fix(testsuite): only inject dialect into heuristic construction when accepted Value-object DataType classes (e.g. MySQLYearType, PostgresBitType) declare no dialect parameter; passing dialect=kwd failed construction. Only inject when the class signature contains 'dialect'. * feat(query): cross-schema ActiveQuery/ActiveRecord tests New feature/query/cross_schema package: two models bound to explicit non-default schemas (ar_crm.customers / ar_shop.orders) joined, counted, written and scoped via ActiveQuery. Tests declare @requires_protocol(SchemaSupport, 'supports_schema') so backends without schema namespaces skip declaratively; provisioning is an optional provider method (setup_schema_fixtures), absent providers skip too. * feat(testsuite): default-vs-non-default schema operation coverage Mixed-schema fixtures subclass existing fixtures and override __schema_name__, so identical DDL is provisioned in the default namespace and SCHEMA_A. Covers coexistence, namespace-scoped PK lookup, scoped update/delete and cross-schema joins between default users and schema-qualified orders. * test(query): comprehensive JOIN capability coverage - join types: LEFT NULL-row semantics, RIGHT preservation, FULL OUTER, CROSS cartesian, mixed-type chains, STRAIGHT_JOIN equivalence - USING-clause joins incl. mutual-exclusivity with ON - true self-joins via runtime-derived aliased proxies (Node tree) - JOIN x GROUP BY/HAVING aggregation, IN-subquery composition - column-qualifier form contracts (two-part columns under joins, schema ranges without three-part references, alias-only addressing) - fix gating: use testsuite.utils.requires_protocol so the tuple marker is honoured; raw pytest.mark two-arg form silently bypassed skips * fix(test): accept two-part column refs in schema-model qualifier contract * docs: add two-level execution classification (一级/二级) to feature README * chore: add changelog fragment for PR #20 (cherry picked from commit b24e19e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Feature: Parallel Testing Infrastructure
Summary
Implements parallel testing capabilities for rhosocial-activerecord backends, introducing a two-level execution classification system and comprehensive cross-schema query test coverage.
Changes
Parallel Testing Plugin
Test Suite Enhancements
feat: cross-schema ActiveQuery/ActiveRecord tests
feat: default-vs-non-default schema operation coverage
feat: shared expression round-trip test utilities
test(query): comprehensive JOIN capability coverage
fix(testsuite): gate CTE error-handling and context tests on basic CTE support
fix(testsuite): only inject dialect into heuristic construction when accepted
fix(test): accept two-part column refs in schema-model qualifier contract
Documentation
Test Plan
Run this test suite using backend-specific configurations:
Related Issues
Targets release:
release/v1.0.0.dev17