Expand description
rapace-testkit: Conformance test suite for rapace transports.
Provides TransportFactory trait and shared test scenarios that all
transports must pass.
§Usage
Each transport crate implements TransportFactory and runs the shared tests:
ⓘ
use rapace_testkit::{TransportFactory, TestError};
struct MyTransportFactory;
impl TransportFactory for MyTransportFactory {
type Transport = MyTransport;
fn connect_pair() -> impl Future<Output = Result<(Self::Transport, Self::Transport), TestError>> + Send {
async { /* create connected pair */ }
}
}
#[tokio::test]
async fn my_transport_unary_happy_path() {
rapace_testkit::run_unary_happy_path::<MyTransportFactory>().await;
}Modules§
- bidirectional
- Bidirectional RPC test harness.
- helper_
binary - Helper binary management for cross-process tests.
Structs§
- Adder
Client - Client stub for the #trait_name service.
- Adder
Impl - Implementation of the Adder service for testing.
- Adder
Registry Client - Registry-aware client stub for the #trait_name service.
- Adder
Server - Server dispatcher for the #trait_name service.
- Large
Blob Service Client - Client stub for the #trait_name service.
- Large
Blob Service Impl - Implementation of LargeBlobService for testing.
- Large
Blob Service Registry Client - Registry-aware client stub for the #trait_name service.
- Large
Blob Service Server - Server dispatcher for the #trait_name service.
- Range
Service Client - Client stub for the #trait_name service.
- Range
Service Impl - Implementation of the RangeService for testing.
- Range
Service Registry Client - Registry-aware client stub for the #trait_name service.
- Range
Service Server - Server dispatcher for the #trait_name service.
Enums§
- Test
Error - Error type for test scenarios.
Constants§
- ADDER_
METHOD_ ID_ ADD - LARGE_
BLOB_ SERVICE_ METHOD_ ID_ CHECKSUM - LARGE_
BLOB_ SERVICE_ METHOD_ ID_ ECHO - LARGE_
BLOB_ SERVICE_ METHOD_ ID_ XOR_ TRANSFORM - RANGE_
SERVICE_ METHOD_ ID_ RANGE
Traits§
- Adder
- Simple arithmetic service used for testing.
- Large
Blob Service - Service that processes large byte payloads.
- Range
Service - Service with server-streaming RPC for testing.
- Transport
Factory - Factory trait for creating transport pairs for testing.
Functions§
- adder_
register - Register this service with a registry.
- large_
blob_ service_ register - Register this service with a registry.
- range_
service_ register - Register this service with a registry.
- run_
bidirectional_ streaming - Test bidirectional streaming: both sides send multiple items.
- run_
cancellation - Test that cancellation frames are correctly transmitted.
- run_
client_ streaming_ happy_ path - Test client-streaming: client sends N items + EOS, server sends single response.
- run_
credit_ grant - Test that credit grants are correctly transmitted.
- run_
deadline_ exceeded - Test that requests with expired deadlines fail with DeadlineExceeded.
- run_
deadline_ success - Test that requests with generous deadlines succeed.
- run_
error_ response - Test that error responses are correctly transmitted.
- run_
large_ blob_ checksum - Test large blob checksum (verifies both directions work for different sizes).
- run_
large_ blob_ echo - Test that large blobs are correctly echoed back.
- run_
large_ blob_ transform - Test large blob transformation.
- run_
macro_ server_ streaming - Test server-streaming using the macro-generated client and server.
- run_
ping_ pong - Test PING/PONG round-trip on control channel.
- run_
server_ streaming_ happy_ path - Test server-streaming: client sends request, server sends N responses + EOS.
- run_
session_ cancel_ control_ frame - Test that Session processes CANCEL control frames and filters subsequent frames.
- run_
session_ cancelled_ channel_ drop - Test that Session silently drops frames for cancelled channels.
- run_
session_ credit_ exhaustion - Test that Session enforces credit limits on data channels.
- run_
session_ deadline_ check - Test Session deadline checking.
- run_
session_ grant_ credits_ control_ frame - Test that Session processes GRANT_CREDITS control frames.
- run_
streaming_ cancellation - Test streaming with cancellation mid-stream.
- run_
unary_ happy_ path - Run a single unary RPC call and verify the result.
- run_
unary_ multiple_ calls - Run multiple unary RPC calls sequentially.