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
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:
@@ -1,6 +1,6 @@
|
||||
"""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
|
||||
rows of lookup data (itemTypes, fields, creatorTypes, etc.) that Zotero
|
||||
requires at startup.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""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:
|
||||
|
||||
- ``core`` — libraries, items, itemTypes, feeds, groups
|
||||
|
||||
@@ -10,7 +10,7 @@ from zot.db import TYPE_MAP, Db
|
||||
from zot.schema import create_db
|
||||
|
||||
# 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()
|
||||
@@ -162,7 +162,7 @@ class TestToDataFrame:
|
||||
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:
|
||||
"""Integration tests against the real Zotero database."""
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ from zot.extract import (
|
||||
)
|
||||
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 ─────────────────────────────────────────────────
|
||||
@@ -266,7 +266,10 @@ class TestExtractorExport:
|
||||
# ── 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:
|
||||
def test_extract_real_notes(self):
|
||||
with Extractor(str(HOST_DB)) as ex:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Tests for zot.table — Pydantic models for all 61 Zotero SQLite tables.
|
||||
|
||||
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
|
||||
@@ -13,7 +13,7 @@ import pytest
|
||||
|
||||
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 ──────────────────────────────────────────────
|
||||
@@ -194,7 +194,7 @@ def _get_all_real_tables() -> list[str]:
|
||||
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:
|
||||
"""Verify Pydantic models match the real Zotero SQLite schema."""
|
||||
|
||||
@@ -293,7 +293,7 @@ class TestSchemaMatchesRealDB:
|
||||
# ── 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:
|
||||
"""Verify bib.sync constants match the real Zotero schema."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user