Repository navigation
Commit 6779f08
authored
feat: parallel testing infrastructure and PostgreSQL backend improvements (#55)
* feat: parallel scenario tests with per-worker database pooling
Wire the testsuite database pool for postgres: register the pool reset
handler, make scenario resolution pool-aware, install core and testsuite
from the feature/parallel-testing branches, and run tests with -n 8.
* fix(test): load testsuite conftest plugin and guard --scenarios registration
Without -p rhosocial.activerecord.testsuite.conftest the pooling hooks never
run, so configure_pool_size stays 0 and every xdist worker falls back to the
shared scenario database, racing on schema DDL. Load the plugin and guard the
backend's own --scenarios option so both conftests coexist.
* fix(test): apply pooled database names in backend and connection feature conftests
* fix(test): apply pooled database names in worker connection params
* fix(test): check for simultaneous double-hold instead of id uniqueness
* fix(test): use a non-empty LSN range for pg_get_wal_records_info
* feat: CLI async unification, --ssl param; postgres backend fixes
* feat(postgres): add named expression/procedure example modules
- Add named_expressions order_expressions (import-safe, prepare_orders_demo helper)
- Add named_procedures order_workflow (OrderProcessingProcedure, max_concurrency=1
for psycopg single-connection concurrency limit)
- Update bash scripts to reference real module paths instead of placeholders
and full module paths for --list (package path returns no entries)
* test(expression): add serialization round-trip coverage for PostgreSQL expressions
* fix(dialect): translate is_auto_increment to GENERATED BY DEFAULT AS IDENTITY
ColumnConstraint(is_auto_increment=True) on PRIMARY_KEY was silently ignored,
producing INTEGER PRIMARY KEY without auto-increment. PostgreSQL requires
explicit GENERATED BY DEFAULT AS IDENTITY for auto-increment columns.
The existing dialect_options['identity'] path is unaffected.
* 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.
* fix(config): declare missing autocommit field on PostgresConnectionConfig
The backend read config.autocommit (requires_manual_commit and the
auto-commit handlers in sync/async backends) to decide whether an
explicit COMMIT is needed outside managed transactions, but the field
did not exist on the dataclass, so passing autocommit=True raised a
TypeError and the option was effectively dead. All other backends
(mysql, sqlserver, clickhouse, snowflake, firebird) already declare it.
Replace the defensive getattr() fallbacks with direct attribute access
and add unit tests covering the default value, explicit assignment,
conninfo exclusion, and requires_manual_commit() for both backends.
* test: cover column qualifier resolution under JOINs
Regression tests for qualifier generation vs FROM context: plain field
accessors, mixed/partial aliases, prebuilt-predicate reuse across
contexts, explicit-alias joins, and an xfail sentinel documenting the
accepted dynamic __table_name__ drift limitation. Companion to the
python-activerecord fix that stops forcing table-name aliases on JOIN
ranges.
* test: cover dynamic table/schema names as supported usage
Replace the R4 xfail sentinel with positive tests for the documented
contract: after changing __table_name__ / __schema_name__, expressions
built through field proxies pick up the new identity, and full DQL stays
consistent across FROM / WHERE / SELECT. Seed an archive table and a
second tenant-style schema so both switch directions assert real data.
* feat(test): provide cross-schema fixtures for testsuite
Implements the optional setup_schema_fixtures capability: provisions
ar_crm / ar_shop schemas with customers and orders tables (sync + async
variants; DDL runs through a short-lived sync connection for async),
tracks created schemas, and drops them in cleanup_after_test. Declares
supports_schema() == True.
* feat(dialect): declare supports_schema capability and schema DDL tests
* fix(protocols): declare supports_schema and supports_schema_authorization in PostgresSchemaSupport
* test(provider): provision mixed default/non-default schema fixtures
* test(adapters): offline adapter round-trip coverage for all types
* docs: record stateflow cross-backend test issues (JSON/bool/RETURNING)
* fix(hstore): pass raw % operator to format_binary_operator to avoid double escaping
hstore_to_array_operator passed the already-escaped '%%' operator to
format_binary_operator, which escapes '%' again to '%%%%' (psycopg folds
to '%%' instead of the expected '%'). Pass the raw '%' so
format_binary_operator performs the single %->%% escape as the sole
collection point.
* fix(adapters): parse array literals on read for list fields in TEXT columns
PostgresListAdapter now parses JSON and PostgreSQL array literals via psycopg's
array loader when reading list fields stored in TEXT columns, fixing the
cross-backend round-trip exposed by stateflow tests.
* test: add format_binary_operator % escaping and hstore operator tests
* 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
* feat(postgres): add pgvector vector_search function and expression type support
- Add vector_search.py function module with pgvector search capabilities
- Extend expression types with pgvector-related serialization
- Add data_type_formatting mixin improvements
- Add vector search and example compile test coverage
* test: add targeted coverage for low-coverage patch areas
- extend PostgresListAdapter string parsing tests (JSON + PG array literal)
- add HALFVEC/SPARSEVEC DDL format/parse and eq/hash coverage
- cover vector_search edge cases (ip similarity, index options, invalid metric)
- add _get_default_schema config-aware resolution tests for both introspection stacks
- cover backend autocommit handler branches (sync + async, True/False)
- add CLI --ssl mapping and --async flag tests
- add CLI blackbox tests for introspect/status --async
fix(cli): correct async introspect method names (remove _async suffix)
The _handle_introspect_async path called nonexistent list_tables_async,
list_views_async etc. Async introspector methods use the same names as
sync (no _async suffix). Fixes broken async introspect branch.
* fix(test): tolerate empty table list in introspect blackbox tests
CI runs against a fresh test_db where 'introspect tables' returns [],
so assert json.loads(out) (truthy) fails. Assert the parsed JSON is a
list instead, which holds whether or not tables exist.
* chore: add changelog fragment for PR #55
* docs: remove non-standard changelog fragment
The file name stateflow-cross-backend-issues.fixed.md does not follow
the <issue_number>.<type>.md convention. Its content was already
merged into the relevant fix commit.1 parent beb040a commit 6779f08
61 files changed
Lines changed: 2824 additions & 569 deletions
File tree
- .github/workflows
- changelog.d
- src/rhosocial/activerecord/backend/impl/postgres
- adapters
- backend
- cli
- examples
- cli/bash
- ddl
- extensions
- named_expressions
- named_procedures
- expression
- functions
- introspection
- mixins
- extensions
- types
- protocols
- extensions
- tests
- providers
- rhosocial
- activerecord_postgres_test/feature
- backend
- dialect
- expression
- introspection
- postgres
- extensions
- types
- connection
- activerecord_test/feature/backend/cli
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
| 71 | + | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
| 282 | + | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
| 325 | + | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
395 | | - | |
| 394 | + | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
| 438 | + | |
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
| 445 | + | |
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
494 | | - | |
| 493 | + | |
| 494 | + | |
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
598 | 600 | | |
599 | 601 | | |
600 | 602 | | |
| 603 | + | |
| 604 | + | |
601 | 605 | | |
602 | 606 | | |
603 | 607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | | - | |
31 | 34 | | |
32 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
33 | 56 | | |
34 | 57 | | |
35 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
36 | 74 | | |
37 | 75 | | |
38 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
647 | | - | |
| 647 | + | |
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
661 | | - | |
| 661 | + | |
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
648 | | - | |
| 648 | + | |
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
| |||
659 | 659 | | |
660 | 660 | | |
661 | 661 | | |
662 | | - | |
| 662 | + | |
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
| |||
0 commit comments