fix: full test-suite green — fetch cache gate, mock scope, migration 0073, fake snapshot ids
Five independent test fixes surfaced running the full musehub suite after this session's earlier changes (branch-delete signing fix, migration 0073 for MusehubVersionTag):
- test_blob_only_object_store.py, test_mpack_phase2.py: wire_fetch_mpack calls with no pre-populated MusehubFetchMPackCache row raised MPackNotReadyError before reaching the DB-vs-S3 sourcing logic these tests actually care about. That cache-freshness gate predates this session (MWP-4, 2026-06-29) and is orthogonal to what's under test — pass force_build=True to bypass it, matching the parameter's intended use. - test_mpack_phase2.py additionally used fake_id() for a snapshot_id instead of the real hash_snapshot(manifest, directories). Production code (_snap_row_to_wire_s3/_cached_manifest_reproduces) validates manifest_blob actually hashes to snapshot_id before trusting it as cached, falling back to delta-chain reconstruction on mismatch — with no parent to reconstruct from, a fake id silently produced an empty manifest (0 blobs) instead of the real content. - test_identity_integration.py: two tests built a bare MagicMock() request without a real .scope dict. The branch-delete signing fix earlier this session added a request.scope.get('raw_path', b'') read to _extract_signed_path; an unconfigured MagicMock's .get() returns a truthy auto-mock instead of the real b'' default, so it never fell back to request.url.path, producing garbage in the signed canonical path. Real Starlette Requests always have a genuine scope dict, so this only mattered for the mock — added request.scope = {}. - test_migrations.py, test_musehub_alembic.py: golden migration count/head constants (_ALL_REVISIONS/_HEAD, _EXPECTED_HEAD/ _EXPECTED_MIGRATION_COUNT) still said 0072/72; bumped to 0073/73 to match the real migration added earlier this session for MusehubVersionTag.
Files Changed
~5
998 in snapshot
0 comments
muse hub commit comment sha256:061a77af58afabc6ed959786a1084a62622ffbed5f8e8582af41de27f3900ea3 --body "your comment"
No comments yet. Be the first to start the discussion.