Skip to main content

Crate runifold_provider_testkit

Crate runifold_provider_testkit 

Source
Expand description

Offline HTTP cassette and fault-injection support for provider adapters.

The server intentionally speaks HTTP/1.1 over a loopback socket. This keeps provider tests independent from a production HTTP stack while still exercising real request serialization, response streaming, delays, and mid-stream disconnects.

Structs§

BenchmarkFailureCount
Count of failures in one normalized category.
BenchmarkInvocation
Result and host-observed timing for one invocation.
BenchmarkPlan
Bounded benchmark execution plan.
BenchmarkRegressionComparison
Complete baseline-to-candidate benchmark decision.
BenchmarkRegressionMetric
One comparable benchmark metric and its gate decision.
BenchmarkRegressionPolicy
Allowed degradation from a baseline report.
CassetteServer
A loopback server executing a fixed sequence of HTTP exchanges.
ErrorContract
Expected classification of a failed provider invocation.
HttpExchange
One expected request and its scripted response.
LatencyDistribution
Latency distribution expressed in integer microseconds.
ModelBenchmarkTarget
Canonical Runifold model adapter for BenchmarkTarget.
ObservedRequest
A request captured by the cassette server.
ProviderBenchmarkReport
Stable, serialization-safe benchmark evidence.
ProviderConformanceReport
Evidence produced by a conformance run.
ResponseChunk
One response body fragment and the delay before it is sent.
ScriptedResponse
A streamed HTTP response, optionally disconnected before its terminator.
ServerStats
Snapshot of cassette-server concurrency and completion counters.
SuccessContract
Expected canonical result of a successful provider invocation.

Enums§

BenchmarkFailureKind
Stable framework-neutral failure category.
BenchmarkInvocationError
Invalid timing evidence supplied by a benchmark adapter.
CassetteError
Errors produced by cassette construction, serving, or verification.
ConformanceCheck
One successfully verified provider behavior.
ProviderBenchmarkError
Benchmark construction or comparison failure.
ProviderConformanceError
A provider violated its canonical acceptance contract.

Traits§

BenchmarkTarget
Framework-neutral operation executed by the benchmark runner.

Functions§

benchmark
Runs warmup and measured invocations against one framework-neutral target.
compare_benchmarks
Compares two reports using one explicit regression policy.
verify_error
Executes and verifies one failed canonical provider invocation.
verify_success
Executes and verifies one successful canonical provider invocation.

Type Aliases§

BenchmarkFuture
A boxed benchmark invocation future.