gabriel / musehub public
test task/bench-cli-only #3 / 3
AI Agent gabriel · 122 days ago · May 15, 2026 · Diff

test: add push XS unit tests P1–P5 (issue #64)

All 7 tests pass against real localhost infrastructure — no mocks, no ASGI, no conftest. P3 polls the pack index before checking MinIO because the bundle.index background job promotes objects from DB cache to MinIO storage.

sha256:e0ed2fb4b0ad11ce0c23a3d1a32f28df520cc12754f6e4da77b5828da84ec3b2 sha
+26 −88 symbols
sha256:fdb4829750403f1dac53713af95ae8975028180b98b042c0cca37430601ca1fd snapshot
+26
symbols added
−88
symbols removed
0
dead code introduced
Semantic Changes 114 symbols
~ tests/test_push_xs_unit.py .py 26 symbols added
+ COMMIT_ID variable variable COMMIT_ID L38–38
+ LOCALHOST variable variable LOCALHOST L27–27
+ OBJ_CONTENT variable variable OBJ_CONTENT L35–35
+ OBJ_ID variable variable OBJ_ID L36–36
+ REPO_ROOT variable variable REPO_ROOT L28–28
+ SNAPSHOT_ID variable variable SNAPSHOT_ID L39–39
+ _build_bundle function function _build_bundle L42–75
+ _muse function function _muse L78–82
+ _muse_check function function _muse_check L85–89
+ Path import import Path L22–22 ← moved from tests/bench_wire.py
+ annotations import import annotations L14–14 ← moved from tests/bench_wire.py
+ hashlib import import hashlib L16–16 ← moved from tests/bench_wire.py
+ json import import json L17–17
+ msgpack import import msgpack L24–24 ← moved from tests/bench_wire.py
+ os import import os L18–18 ← moved from tests/bench_wire.py
+ pytest import import pytest L25–25
+ shutil import import shutil L19–19
+ subprocess import import subprocess L20–20
+ tempfile import import tempfile L21–21
+ test_p1_bundle_key_matches_wire_bytes function function test_p1_bundle_key_matches_wire_bytes L104–110
+ test_p1_bundle_objects_round_trip function function test_p1_bundle_objects_round_trip L113–126
+ test_p1_object_id_matches_content function function test_p1_object_id_matches_content L96–101
+ test_p2_muse_push_xs_exits_zero function function test_p2_muse_push_xs_exits_zero L133–167
+ test_p3_pushed_object_bytes_in_minio_match_content function function test_p3_pushed_object_bytes_in_minio_match_content L174–270
+ test_p4_pack_index_has_row_for_pushed_object function function test_p4_pack_index_has_row_for_pushed_object L277–372
+ test_p5_muse_clone_xs_no_integrity_errors function function test_p5_muse_clone_xs_no_integrity_errors L379–450
~ tests/bench_wire.py .py 88 symbols removed
BenchResult class class BenchResult L136–171
__init__ method method __init__ L137–142
gate method method gate L164–165
gate_pass method method gate_pass L167–171
p50 method method p50 L148–149
p95 method method p95 L151–156
record method method record L144–146
throughput_mbs method method throughput_mbs L158–162
GATES variable variable GATES L91–132
SIZE_MATRIX variable variable SIZE_MATRIX L81–87
VERB_FNS variable variable VERB_FNS L666–671
_AUTH_CTX variable variable _AUTH_CTX L71–76
_DB_URL variable variable _DB_URL L58–61
_ENGINE variable variable _ENGINE L68–68
_FAIL variable variable _FAIL L600–600
_MINIO_BUCKET variable variable _MINIO_BUCKET L63–63
_MINIO_ENDPOINT variable variable _MINIO_ENDPOINT L62–62
_MINIO_KEY variable variable _MINIO_KEY L64–64
_MINIO_REGION variable variable _MINIO_REGION L66–66
_MINIO_SECRET variable variable _MINIO_SECRET L65–65
_PASS variable variable _PASS L599–599
_SESSION_FACTORY variable variable _SESSION_FACTORY L69–69
_SKIP variable variable _SKIP L601–601
_bundle_bytes function function _bundle_bytes L303–314
_c_frame function function _c_frame L277–284
_create_repo function async_function _create_repo L318–324
_e_frame function function _e_frame L286–289
_fetch_bundle function async_function _fetch_bundle L404–450
_fw variable variable _fw L54–54
_gate_str function function _gate_str L603–609
_h_frame function function _h_frame L265–269
_make_commits_chain function function _make_commits_chain L206–261
_make_objects function function _make_objects L193–204
_next_seq function function _next_seq L188–191
_o_frame function function _o_frame L271–275
_pack function function _pack L175–176
_patch_thresholds function function _patch_thresholds L654–662
_print_results function function _print_results L611–650
_push_presign function async_function _push_presign L354–400
_push_stream function async_function _push_stream L328–351
_seed_repo function async_function _seed_repo L454–465
_seq variable variable _seq L186–186
_stream_push_body function function _stream_push_body L291–301
_unpack function function _unpack L178–179
_wrap function function _wrap L181–182
bench_clone function async_function bench_clone L571–595
bench_fetch function async_function bench_fetch L496–523
bench_pull function async_function bench_pull L526–568
bench_push function async_function bench_push L469–493
ASGITransport import import ASGITransport L39–39
Any import import Any L32–32
AsyncClient import import AsyncClient L39–39
Base import import Base L46–46
JSONObject import import JSONObject L45–45
JSONValue import import JSONValue L45–45
MSignContext import import MSignContext L50–50
MuseWireFrameWriter import import MuseWireFrameWriter L44–44
NullPool import import NullPool L41–41
Path import import Path L31–31 → moved to tests/test_push_xs_unit.py
SFRAME_COMMIT_PACK import import SFRAME_COMMIT_PACK L52–52
SFRAME_END import import SFRAME_END L52–52
SFRAME_HEADER import import SFRAME_HEADER L52–52
SFRAME_OBJECT import import SFRAME_OBJECT L52–52
WIRE_CONTENT_TYPE import import WIRE_CONTENT_TYPE L44–44
_database import import _database L47–47
annotations import import annotations L22–22 → moved to tests/test_push_xs_unit.py
app import import app L49–49
argparse import import argparse L24–24
async_sessionmaker import import async_sessionmaker L40–40
asyncio import import asyncio L25–25
blob_id import import blob_id L43–43
create_async_engine import import create_async_engine L40–40
get_db import import get_db L46–46
hashlib import import hashlib L26–26 → moved to tests/test_push_xs_unit.py
httpx import import httpx L37–37
msgpack import import msgpack L38–38 → moved to tests/test_push_xs_unit.py
muse_cli_models import import musehub.db.muse_cli_models L48–48
now_utc_iso import import now_utc_iso L43–43
optional_signed_request import import optional_signed_request L50–50
optional_token import import optional_token L51–51
os import import os L27–27 → moved to tests/test_push_xs_unit.py
require_signed_request import import require_signed_request L50–50
require_valid_token import import require_valid_token L51–51
statistics import import statistics L28–28
sys import import sys L29–29
time import import time L30–30
main function async_function main L746–768
run_size function async_function run_size L674–743

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