fire-planner/tests
Viktor Barzin 23d11bdf6d
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ingest: switch wealthfolio to pg-sync mirror reads
The previous SQLite-direct reader queried `holdings_snapshot` (singular)
and `accounts.type` — both wrong against the live wealthfolio schema
(plural `holdings_snapshots`, column `account_type`). It silently
returned [] via the OperationalError fallback, leaving fire-planner with
stale account snapshots.

Switch to reading from the wealthfolio_sync PG mirror. The pg-sync
sidecar (defined in infra/stacks/wealthfolio) hourly mirrors SQLite to
Postgres with a clean schema. We read from `daily_account_valuation`
which already has total_value, cost_basis, and explicit fx_rate_to_base
per row — no JSON-decoding of position blobs.

CLI ingest no longer takes --db-path (no kubectl-exec gymnastics);
reads WEALTHFOLIO_SYNC_DB_CONNECTION_STRING from env. Falls back to
DB_CONNECTION_STRING for single-DB local dev.

13 new tests covering: latest-per-account, multi-currency FX, explicit
as-of, empty mirror, null cost_basis, full pipeline through upsert.
140 tests pass; mypy strict + ruff clean.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 21:33:48 +00:00
..
__init__.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
conftest.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_cli.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_db_schema.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_e2e.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_ingest_wealthfolio_pg.py ingest: switch wealthfolio to pg-sync mirror reads 2026-05-09 21:33:48 +00:00
test_reporters_pg.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_returns.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_scenarios.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_simulator.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_strategies.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_tax_base.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_tax_other_regimes.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00
test_tax_uk.py Initial extraction from monorepo 2026-05-07 17:06:19 +00:00