Skip to content

Development en

ClarusIubar edited this page Aug 17, 2026 · 3 revisions

Development

한국어 | English

pip install -r requirements-dev.txt
pytest

tests/ is split into 4 layers:

Directory What it guarantees Run
tests/unit/ Individually verifies pure functions in common/ and vendor parser core logic (_active_branch_nodes, _parse_kst, Claude's two loaders, etc) with synthetic data pytest tests/unit
tests/regression/ Reproduces bugs that actually happened in past issues (#11 Gemini nested attachments, #13 __MACOSX ordering, #16 CRLF, Claude's multi-line blockquote nesting and design_chats real field-name mismatches) via the exact path they occurred, to pin them down pytest -m regression
tests/integration/ Verifies the full CLI wiring end to end: argparse → resolve_source → run_vendor → detect/convert → upsert/publish (synthetic fixtures; never touches the real data//config.json) pytest -m integration
tests/smoke/ The shallowest, fastest check — just confirms imports don't break and the CLI at least starts without crashing pytest -m smoke

Full-pipeline verification against real, large-scale takeout data (byte-diff against prior output) isn't included in the automated tests — since it's personal data that can't be committed, it's re-run and compared manually whenever a regression is suspected. This is exactly how the Claude vendor's regression tests came to exist: re-running the pipeline against a real export and cross-checking the source data's block-type counts against the rendered output's marker counts caught a few bugs (inconsistent blockquote nesting depth on multi-line values, timestamps left in raw UTC instead of local time, and a couple of design_chats fields whose real key names didn't match the first guess) that no synthetic fixture had exercised.

run.main() unconditionally reads the project's real config.json (creating it if missing), and falls back to data/<vendor>/ (a real path that may contain personal data) if none is set. The _isolate_real_project_paths autouse fixture in tests/conftest.py automatically isolates both of these paths to temp paths for every test, so forgetting this while writing a new test still keeps real project files safe — but this is only a safety net that makes mistakes harmless, not a license to skip being explicit; CLI-level tests should still be written with --input/--output-dir/--vault-dir explicitly pointed at temp paths.

Related page: Architecture

Clone this wiki locally