gabriel / musehub public
fix task/fix-remaining-test-suite-failures #1 / 1
AI Agent gabriel · 20 days ago · Jul 2, 2026 · Diff

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.

sha256:061a77af58afabc6ed959786a1084a62622ffbed5f8e8582af41de27f3900ea3 sha
+1 ~8 symbols
5 changed · 998 in snapshot files
sha256:d8244cb37fb9fd831f48887fb7752a8c63512126cbe396fdb2cca4346e725659 snapshot
+1
symbol added
~8
symbols modified
5
files changed
998
files in snapshot
0
dead code introduced
Semantic Changes 9 symbols
~ tests/test_migrations.py .py 2 symbols modified
~ tests/test_mpack_phase2.py .py 1 symbol added, 1 symbol modified
+ hash_snapshot import import hash_snapshot L33–33
Files Changed
~5
998 in snapshot
← Older Oldest on task/fix-remaining-test-suite-failures
All commits
Newer → Latest on task/fix-remaining-test-suite-failures

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:061a77af58afabc6ed959786a1084a62622ffbed5f8e8582af41de27f3900ea3 --body "your comment"