Skip to content

test: isolate parallel postgres test runs#52

Draft
lan17 wants to merge 3 commits intomainfrom
codex/shared-pg-test-isolation
Draft

test: isolate parallel postgres test runs#52
lan17 wants to merge 3 commits intomainfrom
codex/shared-pg-test-isolation

Conversation

@lan17
Copy link
Copy Markdown
Owner

@lan17 lan17 commented Apr 12, 2026

Summary

  • provision a unique Postgres schema per test run so concurrent worktrees can share one database safely
  • scope SQLAlchemy engines and Alembic migrations to that schema in test contexts
  • add coverage proving two stores can reuse one Postgres instance without leaking state across schemas

Why

Parallel backend test runs were sharing one database namespace and using global drop_all/create_all, so concurrent worktrees or subagents could destroy each other's tables mid-run.

Validation

  • make check

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 12, 2026

Codecov Report

❌ Patch coverage is 91.93548% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.81%. Comparing base (298a5c5) to head (df60903).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/homesec/postgres_support.py 92.45% 4 Missing ⚠️
src/homesec/telemetry/db_log_handler.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
+ Coverage   83.73%   83.81%   +0.07%     
==========================================
  Files         110      111       +1     
  Lines        9814     9873      +59     
==========================================
+ Hits         8218     8275      +57     
- Misses       1596     1598       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant