- Create 01-02-SUMMARY.md: 19 total xfail tests across 5 files, 3 task commits documented, no deviations - STATE.md: advance to plan 3/5, update progress to 40%, record decisions for async_client naming and xfail(strict=False) pattern - ROADMAP.md: mark 01-02-PLAN.md complete, update progress table to 2/5
7.0 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-infrastructure-foundation | 02 | testing |
|
|
|
|
|
|
Phase 1 Plan 02: Wave 0 Test Scaffolds — Summary
One-liner: Async SQLAlchemy + httpx fixtures added to conftest; 19 xfail Wave 0 tests across 5 files scaffold Plan 03-05 contracts before implementation.
What Was Built
This plan authored all Wave 0 test scaffolds identified in 01-VALIDATION.md before any implementation lands. Every test that depends on Plan 03-05 code is marked xfail(strict=False) so the suite stays green between waves. Later executors remove the xfail markers as their code lands.
Files Created
| File | Purpose | Tests |
|---|---|---|
backend/tests/test_storage.py |
Wave 0 STORE-02 unit tests | 6 xfail tests |
backend/tests/test_alembic.py |
Wave 0 migration integration tests | 2 xfail tests |
Files Modified
| File | Change | Tests Added |
|---|---|---|
backend/tests/conftest.py |
Added db_session + async_client async fixtures |
0 (fixture-only) |
backend/tests/test_health.py |
Added test_health_checks_postgres_and_minio |
1 xfail |
backend/tests/test_documents.py |
Added 9 async port tests + 1 persistence test | 10 xfail |
Total Wave 0 xfail Inventory
| File | xfail count | Unblocked by |
|---|---|---|
| test_storage.py | 6 | Plan 04 |
| test_alembic.py | 2 | Plan 03 |
| test_health.py | 1 | Plan 05 |
| test_documents.py | 10 | Plan 05 |
| Total | 19 | — |
Fixture Inventory (conftest.py)
| Fixture | Type | Scope | Status |
|---|---|---|---|
isolated_data_dir |
sync autouse | function | Retained (Plan 05 removes) |
client |
sync TestClient | function | Retained (Plan 05 removes) |
sample_txt |
sync | function | Retained |
sample_pdf |
sync | function | Retained |
db_session |
async | function | New — skips until Plan 03 |
async_client |
async | function | New — skips until Plan 03 |
Test Functions Added
test_storage.py (all xfail → Plan 04):
test_object_key_schema— regex^[^/]+/[^/]+/{uuid4}(\.ext)?$againstput_objectreturn valuetest_filename_not_in_object_key— asserts "invoice", "Q3", "secret" not in keytest_storage_backend_abc_methods— incomplete subclass raisesTypeErrortest_get_storage_backend_returns_minio— factory returnsMinIOBackendtest_put_object_uses_asyncio_to_thread—asyncio.to_threadwas called with_client.put_objecttest_minio_backend_health_check_returns_bool— returnsTrue/Falseon ok/exception
test_alembic.py (all xfail → Plan 03):
test_migration_creates_all_tables— all 11 v1 tables: users, quotas, refresh_tokens, folders, documents, topics, document_topics, shares, audit_log, cloud_connections, groupstest_documents_user_id_nullable—PRAGMA table_info(documents)confirmsnotnull=0
test_health.py (1 xfail → Plan 05):
test_health_checks_postgres_and_minio— assertschecks.postgres == "ok"andchecks.minio == "ok"
test_documents.py (10 xfail → Plan 05):
test_upload_txt_no_classify_asynctest_upload_pdf_no_classify_asynctest_list_documents_asynctest_list_documents_filter_by_topic_asynctest_get_document_asynctest_get_document_not_found_asynctest_delete_document_asynctest_delete_document_not_found_asynctest_upload_empty_file_asynctest_upload_persists_to_postgres_and_minio_async— UUID id regex + GET round-trip
Commits
| Hash | Message |
|---|---|
1f675fc |
feat(01-02): add async db_session and async_client fixtures to conftest.py |
27fa0d4 |
test(01-02): add Wave 0 scaffolds test_storage.py and test_alembic.py |
d856a2e |
test(01-02): extend test_health.py and port test_documents.py to async client |
Deviations from Plan
None — plan executed exactly as written.
The async_client fixture was named async_client (not client) as specified in the plan action to avoid collision with the legacy sync client fixture. This matches the plan's intent.
Known Stubs
None. All test files reference not-yet-existing modules inside try/except ImportError: pytest.skip() blocks — this is intentional Wave 0 scaffold behavior, not stubs.
Threat Flags
None. All test data is synthetic (no real PII). aiosqlite DB lives in tmp_path and :memory: only (T-01-02-01 mitigated). No new network endpoints introduced.
Self-Check: PASSED
Files exist:
/Users/nik/Documents/Progamming/document_scanner/backend/tests/test_storage.py— FOUND/Users/nik/Documents/Progamming/document_scanner/backend/tests/test_alembic.py— FOUND/Users/nik/Documents/Progamming/document_scanner/backend/tests/conftest.py— FOUND (modified)/Users/nik/Documents/Progamming/document_scanner/backend/tests/test_health.py— FOUND (modified)/Users/nik/Documents/Progamming/document_scanner/backend/tests/test_documents.py— FOUND (modified)
Commits verified in git log:
1f675fc— FOUND27fa0d4— FOUNDd856a2e— FOUND
xfail count: 19 (>= minimum 18 required) Syntax check: PASSED (all 5 files parsed cleanly by Python AST)