Contract tests define the Peer protocol against a real server
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 65/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
First check the network Peer protocol from blocked issue #371, then read tests/testapp/tests/integration/test_syncsession.py:56-219 for the second-server harness. Implement the mixin and network subclass in tests/testapp/tests/integration/test_peer_protocol_contract.py, run the seven contract cases and characterization suite, and confirm pytest does not collect the mixin itself.
由索引模型根据 Issue 内容生成。
描述
Overview
A contract suite describes the expected behavior of the Peer protocol, and it runs against a real network server. This work is part of milestone M3.
Background & Motivation
Later, a disk connection must behave like a morango server. A shared contract suite makes this parity testable. The network connection is the reference implementation, so the suite starts with the network half.
The suite also gives an extra safety net for the operation refactor in milestone M4.
Design: spec. Plan: implementation plan, Task 11.
Description & Expected Outcomes
One abstract test mixin holds the contract cases. It asks each subclass for a connection, a sync session, a local transfer session, and a way to read the records that the peer holds. A network subclass runs the cases against the second-server test harness.
The contract cases are:
- Create, then get, returns an equal
PeerTransferSession. - An update to
records_totalandclient_fsicshows in the next get. - An advance to
serializingreturns that stage with statuscompletedand aserver_fsicvalue. - With zero records, an advance from
queuingtodequeuingreturnsdequeuingwith statuscompleted. - A push of 3 valid records gives
records_transferredequal to 3. - A push of a record with a partition outside the filter raises an error.
- Two close calls, and a close call for an unknown id, do not raise an error.
Deliverables & Contracts
The suite delivers these capabilities:
- The abstract mixin is not collected as a test class by itself.
- The network subclass passes every contract case.
- A disk subclass can reuse every case without a change (#385).
Acceptance Criteria
-
tests/testapp/tests/integration/test_peer_protocol_contract.pycontains the mixin and the network subclass. - All seven contract cases pass for the network subclass.
- Pytest does not collect the mixin as a test case.
- The characterization suite passes without edits.
Technical Pointers & Architecture
- Target Components / Context:
tests/testapp/tests/integration/. - Related Patterns: The second-server harness (
LiveServer,second_environment,PushPullClientTestCase) attests/testapp/tests/integration/test_syncsession.py:56-219. - Data Model & Schema Considerations: None.
- Resilience & Failure Modes: The out-of-filter case raises
requests.HTTPErroron the network andValidationErroron disk. The case accepts both types.
Notes & Tradeoffs
- Dependencies: Blocked by: #371 (Peer protocol on the network connection). Blocks: #385.
- Testing Requirements: The network is the reference. If a case fails on the network, fix the case, not the connection. The characterization suite from #363 and #364 must pass without edits.
- Tradeoffs & Alternatives Considered: A single end-to-end parity test catches less drift than a case-by-case contract. The spec keeps both.
- Compatibility & Migrations: Tests only.
Metadata
- Complexity: Medium
- Target Branch: release-v0.9.x
AI Usage
Drafted with Claude (Claude Code) from the approved design spec and implementation plan. The author reviewed the requirements, and the code references were checked against the release-v0.9.x codebase.
- 主要语言
- Python
- 星标
- 15
- 派生
- 27
- 平均合并
- 6 天 44 分钟
- 30 天内合并 PR
- 13
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
learningequality/morango 的其他 Issue
-
Document disk export and deprecations in the changelog可能重新可做 @ArpitaSamanta10 于 14 天前认领,目前没有进行中的 PR。 未关闭DEV: dev-ops DEV: distributions DOCS: developer
难度 1/5 1-3 小时 新手友好度 78/100
learningequality/morango#387 · 2 条评论 ·
维护者通常 1 天内回复
-
DEV: backend DEV: dev-ops TAG: unit tests
难度 2/5 1-3 小时 新手友好度 70/100
learningequality/morango#385 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 54/100
learningequality/morango#425 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 1/100
learningequality/morango#424 ·
维护者通常 1 天内回复
-
DEV: backend P2 - normal
难度 4/5 3-5 天 新手友好度 35/100
learningequality/morango#416 · 2 条评论 ·
维护者通常 1 天内回复
查看 learningequality/morango 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"可能已有人在做 @cestercian 今天认领。 未关闭comp/cli P2 type/bug
难度 2/5 1-3 小时 新手友好度 75/100
NousResearch/hermes-agent#162259 · 1 条评论 ·
维护者通常 1 天内回复
-
upstream update
难度 2/5 1-3 小时 新手友好度 72/100
conan-io/conan-center-index#31597 ·
维护者通常 1 天内回复
-
bug enhancement
难度 1/5 1 小时以内 新手友好度 90/100
AOSSIE-Org/PictoPy#1802 · 2 条评论 ·
维护者通常 3 天内回复
-
community-request
难度 2/5 1-3 小时 新手友好度 78/100
NVIDIA-NeMo/Run#727 ·
维护者通常 1 天内回复