Skip to main content

Module client

Module client 

Source
Expand description

Shared HTTP/WebSocket test-codegen abstractions.

Per-language e2e codegen (crates/alef-e2e/src/codegen/<lang>.rs) was previously a monolithic ~1k-2k-line file per language that duplicated the structural shape of every test (function header, request build, response assert) and only differed in syntax. This module pulls the common shape into a trait + driver pair so each language file becomes thin: implement primitives, delegate to http_call::render_http_test / ws_script::render_ws_test.

The trait targets the TestClient-driven test shape — i.e. tests call client.METHOD(path, body, headers) against a TestClient exposed by the language binding, rather than spinning up a TCP mock server. Languages that cannot expose TestClient over FFI (Go/Java/C#) implement the same trait but emit code that spawns the binding’s App.serve() on a loopback port and drives it with their stdlib HTTP client.

Modules§

http_call
Shared HTTP-test driver.
ws_script
Shared WebSocket-test driver.

Structs§

CallCtx
Context for rendering a single TestClient HTTP call.

Traits§

TestClientRenderer
Per-language TestClient test renderer.

Functions§

has_meaningful_body
Whether the expected-response carries a non-empty body.
has_meaningful_headers
Whether the expected-response carries any header expectations beyond content-encoding (which the mock layer strips and is therefore not asserted).
is_skipped
Whether a fixture is skipped for the given language.