Contract tests define the Peer protocol against a real server
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 65/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- backend-api-design, testing-qa
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 15
- Forks
- 27
- Ø Merge
- 6 T. 44 Min.
- Gemergte PRs (30 T.)
- 13
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus learningequality/morango
-
Document disk export and deprecations in the changelogEvtl. wieder frei @ArpitaSamanta10 hat das vor 14 Tagen übernommen, und es ist kein Pull Request offen. OffenDEV: dev-ops DEV: distributions DOCS: developer
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 78/100
learningequality/morango#387 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend DEV: dev-ops TAG: unit tests
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
learningequality/morango#385 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 54/100
learningequality/morango#425 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 1/100
learningequality/morango#424 ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend P2 - normal
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
learningequality/morango#416 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in learningequality/morango
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
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"Evtl. vergeben @cestercian hat das heute übernommen. Offencomp/cli P2 type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
NousResearch/hermes-agent#162259 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[request] gRpc/1.86.0Offenupstream update
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
conan-io/conan-center-index#31597 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
AOSSIE-Org/PictoPy#1802 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 3 Tagen
-
community-request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NVIDIA-NeMo/Run#727 ·
Maintainer antworten meist innerhalb von 1 Tag