Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
File renamed without changes.
File renamed without changes.
38 changes: 37 additions & 1 deletion .gemini/testing.md → .claude/testing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> **Important**: This document is a supplement to the main **Testing Architecture and Execution Guide** ([local](../../python-activerecord/.gemini/testing.md) | [github](https://github.com/Rhosocial/python-activerecord/blob/main/.gemini/testing.md)). Please read the core documentation first to understand the overall testing architecture, provider patterns, and capability negotiation. This guide focuses only on details specific to the PostgreSQL backend.
> **Important**: This document is a supplement to the main **Testing Architecture and Execution Guide** ([local](../../python-activerecord/.claude/testing.md) | [github](https://github.com/Rhosocial/python-activerecord/blob/main/.claude/testing.md)). Please read the core documentation first to understand the overall testing architecture, provider patterns, and capability negotiation. This guide focuses only on details specific to the PostgreSQL backend.

# PostgreSQL Backend Testing Guide

Expand Down Expand Up @@ -201,3 +201,39 @@ pytest -k "jsonb"
# View coverage
pytest --cov=rhosocial.activerecord.backend.impl.postgres tests/
```

## 8. CRITICAL: No Parallel Test Execution

**Tests MUST be executed serially. Do NOT use pytest-xdist or similar parallel execution tools.**

### Why Parallel Execution Is Not Supported

The test suite creates database tables with **fixed names** (e.g., `users`, `orders`, `posts`). Each test:

1. Drops existing tables: `DROP TABLE IF EXISTS ... CASCADE`
2. Creates fresh tables with the same names
3. Inserts test data
4. Cleans up after completion

If tests run in parallel, they will:
- Drop tables while other tests are using them → Errors
- Create conflicting data → Test failures
- Cleanup prematurely → Data loss

### What NOT To Do

```bash
# DO NOT use parallel execution
pytest -n auto # ❌ WILL CAUSE FAILURES
pytest -n 4 # ❌ WILL CAUSE FAILURES
pytest --dist=loadfile # ❌ WILL CAUSE FAILURES
```

### Correct Execution

```bash
# Always run tests serially (default behavior)
pytest # ✅ Correct - serial execution
```

For more details, see the main project's [Testing Documentation](https://github.com/Rhosocial/python-activerecord/blob/main/.claude/testing.md).
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ jobs:

- name: Install activerecord and testsuite from git
run: |
pip install rhosocial-activerecord==1.0.0.dev14
pip install rhosocial-activerecord-testsuite==1.0.0.dev4
pip install rhosocial-activerecord==1.0.0.dev15
pip install rhosocial-activerecord-testsuite==1.0.0.dev5

- name: Create postgres scenario config
run: |
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [v1.0.0.dev4] - 2026-02-27

### Added

- PostgreSQL backend adaptation to new expression-dialect architecture. ([#4](https://github.com/rhosocial/python-activerecord-postgres/issues/4))
- Implemented `introspect_and_adapt()` in PostgreSQL backends to achieve full sync/async symmetry with the core backend interface. ([#5](https://github.com/rhosocial/python-activerecord-postgres/issues/5))


## [1.0.0.dev2] - 2025-12-11

### Added
Expand Down
Loading