Skip to content

v6: expand end-to-end test coverage (auth/notifier E2E, write lifecycle, concurrency, multi-cluster) #74

Description

@Pandys

Summary

The unit surface is well covered (99% of the hand-written code after #73), but several end-to-end / integration scenarios have no coverage. The in-process gRPC harness (tests/_grpc_fakes.py + tests/test_grpc_harness.py) is strong for the data family, but the gaps below close real risk that line coverage doesn't reflect. Surfaced by a test-gap review.

Gaps to close

  1. auth and notifier families have zero E2E coverage. _grpc_fakes.py only wires CollectionManagement, AggregateManagement, InsertManagement; endpoints for auth/notifier point at the same address but no auth/notifier RPC is ever driven over the wire. Add a fake authoriser servicer and drive at least one cf.auth.* flow (e.g. api-key generate) end-to-end.

  2. No full write-lifecycle over the wire. There's no delete/update fake servicer, so append → update → read and delete → read-empty are never exercised end-to-end. The _id-preservation-for-round-trip contract is asserted only against LocalMock, never a real channel.

  3. No concurrency test. The fake server runs an 8-worker pool and GrpcTransport.channel_for guards channel creation with a lock, but no test issues concurrent RPCs through a single Clappform instance to prove the channel cache/lock is correct under contention.

  4. No real multi-cluster E2E. Multi-cluster is only tested with two LocalMocks (docs snippets). Stand up two FakeClusters on two ports, drive two clients (or with_location across genuinely different clusters), and assert no cross-tenant/cross-cluster leakage of data or metadata over real channels.

  5. No streaming backpressure / large-payload / cancellation coverage. The fake yields one small row per chunk; the 64 MiB channel limits are never approached, and no test abandons a stream early to verify RPC/channel teardown.

  6. Broaden the contract smoke test. tests/test_contract_smoke.py hits a single RPC (client.collection.get_all). Since the in-process fakes mirror the client's own assumptions and can't catch client/server drift, adding one streaming data read and one auth RPC against staging would materially increase drift detection in the proto-sync workflow.

Notes

  • Unit-level gaps were already closed (test: harden transport/client/discovery coverage to 99% #73, → 99%). This issue is specifically the E2E/integration layer, which is a larger, separate investment.
  • Reference: the residual line-coverage misses (_client.py:196, dataframes.py:173, _local_mock.py) are intentional/defensive and out of scope here.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestv6v6 rewrite (Major/6)

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions