datum_test 1.1.0
datum_test: ^1.1.0 copied to clipboard
Adapter conformance test kit for the Datum ecosystem — certify any LocalAdapter/RemoteAdapter with one call, plus a real HTTP sync-server harness with fault injection.
1.1.0 #
- Initial release.
runWatchConformanceTests— certifies the reactive watch contract on any local adapter: a current snapshot for EVERY listener (including a second concurrent one),includeInitialData: false, re-emission on every write, query-scoped and by-id watching (deletion surfaces as null), and user-scoped emissions.- The local-adapter kit now certifies cross-user id independence: two users owning the same entity id must not clobber each other through create/update/patch/delete (the InMemory/Hive/SQLite adapters previously disagreed on this contract).
runTypedQueryConformanceTests— certifies typed queries (DatumFieldSpecthroughDatumQueryBuilder) as a supported default on any local adapter: for the full operator matrix (comparisons, membership, between, string operators, null checks, composites, ordering, pagination) the typed path, the string path, and a reference evaluation must return identical results.runAutoMigrationConformanceTests— certifies theDatumSchemaauto-migration contract against any local adapter: legacy-store reconciliation (rename-with-hint keeps values, adds backfill defaults), kept-vs-dropped undeclared columns, and fingerprint run-once across a simulated relaunch.runSyncStackConformanceTests— the full engine behavior matrix (push/pull round-trips, two-device convergence, offline queue replay, LWW conflict resolution with winner push-back, soft-delete propagation, stale-write protection, user isolation, no-op cycles, batch pushes, metadata beacons, incremental pulls) over ANY local/remote adapter pair: passing it certifies the pair as a compatible sync stack.TestConnectivityChecker— flippable connectivity for offline/replay scenarios.CursorHttpRemoteAdapter— reference implementation of cursor-based incremental pull (CursorSyncCapable) against the server's/changesfeed.LocalSyncServergained a cursor change feed (GET /changes?cursor=) and periodic chaos knobs (failEveryNth,dropEveryNth,corruptEveryNth,jitter) alongside the one-shot faults.runChaosConformanceTests+ five stockChaosProfiles (flaky3G, unstableSocket, proxyCorruption, captivePortal, offlineWindows) — certifies eventual convergence, drained queues, and zero loss/duplication once faults clear, with provable per-profile fault counts.runCrashRecoveryConformanceTests— persistent-storage contract: queued ops survive a crash and deliver exactly once after reopen; mid-sync severed-socket crashes recover; schema version/metadata/last-result survive.runConvergenceFuzzTests— seeded multi-device randomized workloads (create/update/soft-delete, random sync interleavings) asserting fleet-wide convergence after quiescence, in both full-pull and cursor-feed modes; failure messages carry the seed for reproduction. The fuzz found and drove the fix for two real engine bugs (equal-version concurrent-edit detection and the LWW tie-break split-brain).runMigrationConformanceTests— the standard migration chain over map-based or SQL executors: stamping, fail-fast on invalid chains, mid-chain rollback, resume, and relaunch run-once semantics.measureAdapterPerformance/runAdapterPerformanceTests— self-verifying ops/sec report per CRUD phase with optional thresholds (report-only by default).runLocalAdapterConformanceTests— 25-test behavioral contract forLocalAdapterimplementations (CRUD, user scoping, queries, pending operations, sync state, migration raw-data fidelity, storage size, capability checks for watch/transaction/pagination).runRemoteAdapterConformanceTests— 10-test contract forRemoteAdapterimplementations, including theDeltaSyncCapable.readSincewatermark contract.ConformanceEntity— the standard entity adapters are certified against.LocalSyncServer— realdart:ioHTTP sync server with fault injection (latency, failure codes, offline windows, severed sockets, version conflicts, response corruption).HttpRemoteAdapter— reference REST adapter with production-grade error mapping and incremental pull.