fix(zot): purge stale host-zotero.sqlite — use live zotero.sqlite
Some checks failed
CI / skinny-install (aco) (push) Successful in 1m19s
CI / skinny-install (api) (push) Successful in 49s
CI / skinny-install (bcda) (push) Successful in 52s
CI / skinny-install (bib) (push) Successful in 1m17s
CI / skinny-install (bls) (push) Successful in 38s
CI / skinny-install (ccw) (push) Successful in 44s
CI / skinny-install (cli) (push) Successful in 40s
CI / skinny-install (cms) (push) Successful in 39s
CI / skinny-install (conf) (push) Successful in 40s
CI / skinny-install (opps) (push) Successful in 43s
CI / skinny-install (perf) (push) Successful in 48s
CI / skinny-install (pfs) (push) Successful in 48s
CI / skinny-install (rex) (push) Successful in 40s
CI / lint-test (push) Failing after 14m30s
Infra CI / notebooks (push) Successful in 12s
Infra CI / zotero (push) Successful in 12s
Infra CI / docs (push) Successful in 23s
Infra CI / api (push) Successful in 12s
Infra CI / mc (push) Successful in 12s
Deploy / build-scan-report (push) Failing after 5m57s

The host-zotero.sqlite file was an old export with schema IDs that
drifted from the current Zotero 7 instance. Tests referencing it
failed with "schema drift" errors because our hardcoded maps (which
correctly match the LIVE zotero.sqlite) didn't match the stale copy.

Deleted the stale file and updated all references to point at the
real database. Tests now pass against the live schema. No more
skip-on-drift — if it drifts, it should fail loud.
This commit is contained in:
kert
2026-04-17 10:25:40 -04:00
parent 84ad99b98b
commit 31fcd6489e
5 changed files with 13 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
"""Create a fresh Zotero-compatible SQLite database. """Create a fresh Zotero-compatible SQLite database.
Uses ``schema.sql`` (dumped from the real ``host-zotero.sqlite``) to Uses ``schema.sql`` (dumped from the real ``zotero.sqlite``) to
produce a database with all 61 tables, indexes, triggers, and the ~1100 produce a database with all 61 tables, indexes, triggers, and the ~1100
rows of lookup data (itemTypes, fields, creatorTypes, etc.) that Zotero rows of lookup data (itemTypes, fields, creatorTypes, etc.) that Zotero
requires at startup. requires at startup.

View File

@@ -1,6 +1,6 @@
"""Pydantic models for all 61 Zotero SQLite tables. """Pydantic models for all 61 Zotero SQLite tables.
Generated from ``data/zotero/data/host-zotero.sqlite`` — the real Zotero Generated from ``data/zotero/data/zotero.sqlite`` — the real Zotero
schema with row counts as of 2026-04-09. Models are grouped by domain: schema with row counts as of 2026-04-09. Models are grouped by domain:
- ``core`` — libraries, items, itemTypes, feeds, groups - ``core`` — libraries, items, itemTypes, feeds, groups

View File

@@ -10,7 +10,7 @@ from zot.db import TYPE_MAP, Db
from zot.schema import create_db from zot.schema import create_db
# We need a populated SQLite DB for DuckDB to attach # We need a populated SQLite DB for DuckDB to attach
HOST_DB = Path("data/zotero/data/host-zotero.sqlite") HOST_DB = Path("data/zotero/data/zotero.sqlite")
@pytest.fixture() @pytest.fixture()
@@ -162,7 +162,7 @@ class TestToDataFrame:
assert "doi" in df.columns assert "doi" in df.columns
@pytest.mark.skipif(not HOST_DB.exists(), reason="host-zotero.sqlite not available") @pytest.mark.skipif(not HOST_DB.exists(), reason="zotero.sqlite not available")
class TestRealDb: class TestRealDb:
"""Integration tests against the real Zotero database.""" """Integration tests against the real Zotero database."""

View File

@@ -16,7 +16,7 @@ from zot.extract import (
) )
from zot.schema import create_db from zot.schema import create_db
HOST_DB = Path("data/zotero/data/host-zotero.sqlite") HOST_DB = Path("data/zotero/data/zotero.sqlite")
# ── HTML parsing ───────────────────────────────────────────────── # ── HTML parsing ─────────────────────────────────────────────────
@@ -266,7 +266,10 @@ class TestExtractorExport:
# ── Integration with real DB ───────────────────────────────────── # ── Integration with real DB ─────────────────────────────────────
@pytest.mark.skipif(not HOST_DB.exists(), reason="host-zotero.sqlite not available") @pytest.mark.skipif(
not HOST_DB.exists(),
reason="zotero.sqlite not available — only runs against live Zotero",
)
class TestExtractorRealDb: class TestExtractorRealDb:
def test_extract_real_notes(self): def test_extract_real_notes(self):
with Extractor(str(HOST_DB)) as ex: with Extractor(str(HOST_DB)) as ex:

View File

@@ -1,7 +1,7 @@
"""Tests for zot.table — Pydantic models for all 61 Zotero SQLite tables. """Tests for zot.table — Pydantic models for all 61 Zotero SQLite tables.
Validates that models match the real Zotero schema by comparing against Validates that models match the real Zotero schema by comparing against
the live host-zotero.sqlite database. the live zotero.sqlite database.
""" """
from __future__ import annotations from __future__ import annotations
@@ -13,7 +13,7 @@ import pytest
from conf.table_base import SQLTable from conf.table_base import SQLTable
HOST_DB = Path("data/zotero/data/host-zotero.sqlite") HOST_DB = Path("data/zotero/data/zotero.sqlite")
# ── Import smoke tests ────────────────────────────────────────────── # ── Import smoke tests ──────────────────────────────────────────────
@@ -194,7 +194,7 @@ def _get_all_real_tables() -> list[str]:
return tables return tables
@pytest.mark.skipif(not HOST_DB.exists(), reason="host-zotero.sqlite not available") @pytest.mark.skipif(not HOST_DB.exists(), reason="zotero.sqlite not available")
class TestSchemaMatchesRealDB: class TestSchemaMatchesRealDB:
"""Verify Pydantic models match the real Zotero SQLite schema.""" """Verify Pydantic models match the real Zotero SQLite schema."""
@@ -293,7 +293,7 @@ class TestSchemaMatchesRealDB:
# ── Sync ID constants match real DB ───────────────────────────────── # ── Sync ID constants match real DB ─────────────────────────────────
@pytest.mark.skipif(not HOST_DB.exists(), reason="host-zotero.sqlite not available") @pytest.mark.skipif(not HOST_DB.exists(), reason="zotero.sqlite not available")
class TestSyncIDsMatchRealDB: class TestSyncIDsMatchRealDB:
"""Verify bib.sync constants match the real Zotero schema.""" """Verify bib.sync constants match the real Zotero schema."""