gabriel / musehub public
test patch task/step3-server-tests #1 / 1
AI Agent gabriel · 120 days ago · May 16, 2026 · Diff

test: step 3 server-side tests for push/unpack-mpack (tiers 1-7)

19 tests across two files: - test_wire_mpack_unpack_step3_e2e.py: S3E2E-1..7 (ASGI + real DB + stub MinIO) - test_wire_mpack_unpack_step3_tiers4567.py: T4 stress, T5 integrity, T6 perf, T7 security

Covers: happy path, missing key, count overflow, MinIO not found, sha256 mismatch, unauthenticated access, concurrent job enqueue, branch create/update idempotency, job payload correctness, latency gate, malformed/oversized key rejection.

sha256:ffe1482bf51ee77964f52a670124ef58dbc4b2090cc55335a723ae771374909d sha
+85 ~1 symbols
sha256:64109e81006276faabe394f1394c0b1e48d518cb7ca522e0813eb5e6f0ba8369 snapshot
+85
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 86 symbols
+ _AUTH_CTX variable variable _AUTH_CTX L69–74
+ _HEAD variable variable _HEAD L67–67
+ _IDENTITY_ID variable variable _IDENTITY_ID L60–60
+ _MPACK_BYTES variable variable _MPACK_BYTES L62–65
+ _MPACK_KEY variable variable _MPACK_KEY L66–66
+ _OWNER variable variable _OWNER L59–59
+ _REPO_NAME variable variable _REPO_NAME L61–61
+ _unpack_body function function _unpack_body L123–141
+ client function async_function client L82–95
+ ASGITransport import import ASGITransport L45–45
+ AsyncClient import import AsyncClient L45–45
+ AsyncSession import import AsyncSession L46–46
+ MSignContext import import MSignContext L50–50
+ annotations import import annotations L37–37
+ app import import app L54–54
+ blob_id import import blob_id L48–48
+ compute_identity_id import import compute_identity_id L52–52
+ create_repo import import create_repo L55–55
+ fake_id import import fake_id L48–48
+ get_db import import get_db L53–53
+ get_settings import import get_settings L51–51
+ hashlib import import hashlib L39–39
+ logging import import logging L40–40
+ msgpack import import msgpack L42–42
+ pytest import import pytest L43–43
+ pytest_asyncio import import pytest_asyncio L44–44
+ require_valid_token import import require_valid_token L49–49
+ logger variable variable logger L57–57
+ mock_get_mpack function async_function mock_get_mpack L113–120
+ repo function async_function repo L99–109
+ test_s3e2e1_happy_path_returns_all_fields function async_function test_s3e2e1_happy_path_returns_all_fields L149–178
+ test_s3e2e2_missing_mpack_key_returns_422 function async_function test_s3e2e2_missing_mpack_key_returns_422 L186–199
+ test_s3e2e3_excessive_commits_count_returns_422 function async_function test_s3e2e3_excessive_commits_count_returns_422 L207–224
+ test_s3e2e4_excessive_objects_count_returns_422 function async_function test_s3e2e4_excessive_objects_count_returns_422 L232–249
+ test_s3e2e5_mpack_not_in_minio_returns_422 function async_function test_s3e2e5_mpack_not_in_minio_returns_422 L257–271
+ test_s3e2e6_sha256_mismatch_returns_422 function async_function test_s3e2e6_sha256_mismatch_returns_422 L279–295
+ test_s3e2e7_unauthenticated_returns_401_or_403 function async_function test_s3e2e7_unauthenticated_returns_401_or_403 L303–328
+ _AUTH_CTX variable variable _AUTH_CTX L43–48
+ _HEAD variable variable _HEAD L41–41
+ _IDENTITY_ID variable variable _IDENTITY_ID L32–32
+ _MPACK_BYTES variable variable _MPACK_BYTES L36–39
+ _MPACK_KEY variable variable _MPACK_KEY L40–40
+ _OTHER_IDENTITY_ID variable variable _OTHER_IDENTITY_ID L33–33
+ _OWNER variable variable _OWNER L31–31
+ _REPO_NAME variable variable _REPO_NAME L34–34
+ _body function function _body L86–102
+ _make_client function function _make_client L78–83
+ _unpack function async_function _unpack L105–111
+ ASGITransport import import ASGITransport L16–16
+ AsyncClient import import AsyncClient L16–16
+ AsyncSession import import AsyncSession L18–18
+ MSignContext import import MSignContext L22–22
+ MusehubBackgroundJob import import MusehubBackgroundJob L26–26
+ MusehubBranch import import MusehubBranch L27–27
+ annotations import import annotations L8–8
+ app import import app L28–28
+ asyncio import import asyncio L10–10
+ blob_id import import blob_id L20–20
+ compute_identity_id import import compute_identity_id L24–24
+ create_repo import import create_repo L29–29
+ fake_id import import fake_id L20–20
+ func function import func L17–17
+ get_db import import get_db L25–25
+ get_settings import import get_settings L23–23
+ msgpack import import msgpack L13–13
+ pytest import import pytest L14–14
+ pytest_asyncio import import pytest_asyncio L15–15
+ require_valid_token import import require_valid_token L21–21
+ select import import select L17–17
+ text import import text L17–17
+ time import import time L11–11
+ mock_get_mpack function async_function mock_get_mpack L70–75
+ repo function async_function repo L56–66
+ test_t4_concurrent_branch_updates_for_same_branch function async_function test_t4_concurrent_branch_updates_for_same_branch L167–221
+ test_t4_concurrent_unpack_calls_all_succeed function async_function test_t4_concurrent_unpack_calls_all_succeed L120–162
+ test_t5_branch_row_created_when_head_provided function async_function test_t5_branch_row_created_when_head_provided L257–277
+ test_t5_branch_row_updated_when_branch_exists function async_function test_t5_branch_row_updated_when_branch_exists L282–327
+ test_t5_job_row_not_written_on_mpack_not_found function async_function test_t5_job_row_not_written_on_mpack_not_found L332–354
+ test_t5_job_row_written_with_correct_payload function async_function test_t5_job_row_written_with_correct_payload L230–252
+ test_t6_job_index_query_uses_index function async_function test_t6_job_index_query_uses_index L388–399
+ test_t6_unpack_latency_under_100ms function async_function test_t6_unpack_latency_under_100ms L363–383
+ test_t7_commits_count_overflow_rejected function async_function test_t7_commits_count_overflow_rejected L478–504
+ test_t7_malformed_mpack_key_rejected function async_function test_t7_malformed_mpack_key_rejected L408–421
+ test_t7_oversized_key_field_rejected function async_function test_t7_oversized_key_field_rejected L426–441
+ test_t7_unauthenticated_request_rejected function async_function test_t7_unauthenticated_request_rejected L446–473
← Older Oldest on task/step3-server-tests
All commits
Newer → Latest on task/step3-server-tests

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:ffe1482bf51ee77964f52a670124ef58dbc4b2090cc55335a723ae771374909d --body "your comment"