Prove that an exported archive matches a network server
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start with tests/testapp/tests/integration/test_disk_export.py and compare its setup with PushPullClientTestCase and LiveServer in tests/testapp/tests/integration/test_syncsession.py. Run python -O -m pytest tests/testapp/tests/integration/test_disk_export.py -v, then verify parity, archive contents, chunking results, failure cleanup, and the PostgreSQL integration suite with tox -e postgres -- tests/testapp/tests/integration.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Overview
Integration tests prove that a full export produces a complete archive with the same data as a network server that receives the same push. This issue is part of milestone M7 (verification).
Background & Motivation
The parity rule is the central promise of the design. An archive holds the same morango state as a server that receives the same push, plus a manifest. Future import (Phase 2) and incremental update (Phase 4) depend on this promise.
These tests also cover the full export flow through the public API, chunked transfers, and cleanup after a failure.
Design: spec. Plan: implementation plan, Task 25.
Description & Expected Outcomes
A parity test pushes the same facility data twice with the same filter. One push goes to the second-server test harness, and one push goes to a disk connection. The test compares the Store, RecordMaxCounter and DatabaseMaxCounter rows of the two receivers. The test ignores rows that use the instance ID of each receiver.
An end-to-end test runs a full export through the public API and reopens the archive. The archive must match every row of the "Archive contents at completion" table in spec §3.4.
A chunking test uses a small chunk size, so that the transfer takes more than one cycle. A failure test forces an error during the transfer. After the host closes the sync session and the connection, no archive file, partial file, lock file or archive alias remains.
Deliverables & Contracts
The feature delivers these capabilities:
- A parity test against the second-server harness.
- An end-to-end export test through
create_disk_connectionand the push client. - A chunking test and a failure-injection test.
Acceptance Criteria
- The parity test finds equal
Store,RecordMaxCounterandDatabaseMaxCounterrows indefault2and in the reopened archive. - The end-to-end test finds every row of the spec §3.4 contents table in the archive.
- With
chunk_size=2and 5 records, the push transfer runs 3 times, with resultsPENDING,PENDING,COMPLETED. - If
DiskSyncConnection.push_record_chunkraisesOSError,run()raisesMorangoError. - After the failure and a call to
close_sync_session()andclose(), nopath,.partialor.lockfile exists. - After the failure, no key that starts with
ARCHIVE_ALIAS_PREFIXis inconnections.databases. - All tests pass on SQLite and in the
postgrestox environment.
Technical Pointers & Architecture
- Target Components / Context:
tests/testapp/tests/integration/test_disk_export.py. - Related Patterns:
PushPullClientTestCaseandLiveServerintests/testapp/tests/integration/test_syncsession.pygive the seed data and the second server. - Data Model & Schema Considerations: None.
- Resilience & Failure Modes: The failure test covers the discard path of the archive.
Notes & Tradeoffs
- Dependencies: Blocked by: #375 (deprecated network operation names and override order), #384 (disk Peer protocol). Blocks: #387.
- Kolibri companion changes: See spec §3.9. Kolibri routers must allow morango migrations on aliases that start with
morango_archive_. Kolibri settings overrides must list thePeer*operations. - Testing Requirements: Run
python -O -m pytest tests/testapp/tests/integration/test_disk_export.py -vandtox -e postgres -- tests/testapp/tests/integration. With a PostgreSQL host, the archive stays SQLite. - Tradeoffs & Alternatives Considered: The tests read the server data from the
default2alias of the test settings.
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.
- Lingua principale
- Python
- Stelle
- 15
- Fork
- 23
- Merge medio
- 1g 11h
- PR unite (30g)
- 4
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di learningequality/morango
-
DEV: dev-ops DEV: distributions DOCS: developer
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
learningequality/morango#387 ·
-
DEV: backend DEV: dev-ops TAG: unit tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
learningequality/morango#385 ·
-
DEV: backend P0 - critical TAG: tech update / debt TAG: unit tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
learningequality/morango#364 ·
-
DEV: backend TAG: new feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
learningequality/morango#388 ·
-
DEV: backend P0 - critical TAG: new feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
learningequality/morango#384 ·
Tutte le issue di learningequality/morango
Issue simili
-
Link Checker ReportApertaautomated issue report
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
RapidAI/RapidOCRDocs#119 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
btclib-org/btclib-node#1833 ·
I maintainer di solito rispondono entro 1 giorno
-
IRIS reader: no-data velocity bins (DB_VEL, DB_VELC) returned as 0.0 m/s instead of NaNForse già presa @syedhamidali l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
elodin-sys/elodin#890 ·
I maintainer di solito rispondono entro 1 giorno