miroir/crates/miroir-proxy/tests
jedarden d02486187d P2.2: Add write path acceptance tests
Added comprehensive acceptance tests for the write path implementation:
- POST /indexes/{uid}/documents - add documents
- PUT /indexes/{uid}/documents - replace documents
- DELETE /indexes/{uid}/documents/{id} - delete by ID
- DELETE /indexes/{uid}/documents - delete by IDs array or filter

Acceptance criteria verified:
1. 1000 docs indexed via POST — every doc fetch-by-id returns the same doc
2. Docs distribute across all configured nodes (no node holds < 20%)
3. Batch with one missing primary key → 400 miroir_primary_key_required
4. Doc containing _miroir_shard → 400 miroir_reserved_field
5. RG=2, RF=1, 1 group down: write succeeds with X-Miroir-Degraded: groups=1
6. RG=2, RF=1, both groups down: 503 miroir_no_quorum
7. DELETE by IDs array routes each ID to its shard independently

All tests pass. The write path implementation in documents.rs was already
complete and handles all required functionality including:
- Primary key extraction and validation
- _miroir_shard injection and reserved field rejection
- Two-rule quorum (per-group quorum + at least one group met quorum)
- Per-batch grouping for efficient fan-out
- Session pinning support (plan §13.6)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 13:01:33 -04:00
..
docker_compose_integration.rs P9.2: Integration test harness with docker-compose 2026-05-23 07:33:34 -04:00
header_contract.rs P2.10: Implement custom HTTP header contract test suite 2026-05-20 07:14:53 -04:00
p2_2_write_path_acceptance.rs P2.2: Add write path acceptance tests 2026-05-23 13:01:33 -04:00
p2_8_middleware_acceptance_tests.rs P2.8: Verify middleware implementation - structured logging + Prometheus metrics + request IDs 2026-05-23 12:43:49 -04:00
p2_phase2_dod.rs P10.2: nodeMasterKey zero-downtime rotation flow 2026-04-19 15:49:40 -04:00
p3_phase3_task_registry.rs P5.5.b: Fix verify phase parallel execution + test compilation 2026-05-23 07:59:14 -04:00
p5_5_two_phase_settings_broadcast.rs P5.5 §13.5 Two-phase settings broadcast + drift reconciler (OP#4) 2026-05-05 12:50:25 -04:00
p5_8_a_anti_entropy_fingerprint.rs P5.8 §13.8: Anti-entropy shard reconciler (OP#1 closure) 2026-05-23 11:23:36 -04:00
p5_8_b_anti_entropy_diff.rs P5.8 §13.8: Anti-entropy shard reconciler (OP#1 closure) 2026-05-23 11:23:36 -04:00
p5_14_ttl_automatic_expiration.rs P5.8 §13.8: Anti-entropy shard reconciler (OP#1 closure) 2026-05-23 11:23:36 -04:00
p7_1_core_metrics.rs P7.1: Core metrics families acceptance tests 2026-05-23 02:29:28 -04:00
p7_5_structured_logging.rs P3.3.d: Fix compilation - add missing local_search_ui_rate_limiter field 2026-04-26 11:18:02 -04:00
p10_5_scoped_key_rotation.rs P3: Task Registry + Persistence — 14-table SQLite schema, Redis mirror, Helm validation 2026-04-24 15:50:20 -04:00
p10_admin_session_revocation.rs P3: Task Registry + Persistence — 14-table SQLite schema, Redis mirror, Helm validation 2026-04-24 15:50:20 -04:00
p13_6_session_pinning.rs P5.6 §13.6: Add integration tests for session pinning 2026-05-23 00:57:18 -04:00
p13_7_alias_resolution.rs P5.7 §13.7: Add atomic index alias integration tests 2026-05-23 00:48:14 -04:00
p13_7_full_alias_integration.rs P5.7 §13.7: Add atomic index alias integration tests 2026-05-23 00:48:14 -04:00
p24_index_lifecycle.rs P2.4: Fix build and test for index lifecycle endpoints 2026-04-19 07:49:46 -04:00
p29_reserved_field_rejection.rs miroir-zc2.3: Validate 2× transient load caveat for online resharding (P12.OP3) 2026-05-20 07:24:22 -04:00
README_integration.md P9.2: Integration test harness with docker-compose 2026-05-23 07:33:34 -04:00