pub struct Fixture {Show 16 fields
pub id: String,
pub category: Option<String>,
pub description: String,
pub tags: Vec<String>,
pub skip: Option<SkipDirective>,
pub env: Option<FixtureEnv>,
pub setup: Vec<SetupCall>,
pub call: Option<String>,
pub input: Value,
pub mock_response: Option<MockResponse>,
pub visitor: Option<VisitorSpec>,
pub args: Vec<ArgMapping>,
pub assertion_recipes: Vec<String>,
pub assertions: Vec<Assertion>,
pub source: String,
pub http: Option<HttpFixture>,
}Expand description
A single e2e test fixture.
Fields§
§id: StringUnique identifier (used as test function name).
category: Option<String>Optional category (defaults to parent directory name).
description: StringHuman-readable description.
Optional tags for filtering.
skip: Option<SkipDirective>Skip directive.
env: Option<FixtureEnv>Environment variable requirements (used by smoke/live tests).
setup: Vec<SetupCall>Setup calls executed before the main call (used to register backends, etc).
call: Option<String>Named call config to use (references [e2e.calls.<name>]).
When omitted, uses the default [e2e.call].
input: ValueInput data passed to the function under test.
mock_response: Option<MockResponse>Optional mock HTTP response for testing HTTP clients.
visitor: Option<VisitorSpec>Optional visitor specification for visitor pattern tests.
args: Vec<ArgMapping>Fixture-level argument mappings. When non-empty, overrides call_config.args for this specific fixture (used for trait-bridge stubs and other per-fixture args).
assertion_recipes: Vec<String>Assertion recipes this fixture opts into.
Domain-shaped assertions such as embeddings, keyword extraction, tree-query helpers, and streaming pseudo-fields require an explicit recipe opt-in so generic e2e fixtures don’t silently inherit project-specific assumptions.
assertions: Vec<Assertion>List of assertions to check.
source: StringSource file path (populated during loading).
http: Option<HttpFixture>HTTP server test specification. When present, this fixture tests an HTTP handler rather than a function call.
Implementations§
Source§impl Fixture
impl Fixture
Sourcepub fn resolved_args<'a>(
&'a self,
call_config: &'a CallConfig,
) -> &'a [ArgMapping]
pub fn resolved_args<'a>( &'a self, call_config: &'a CallConfig, ) -> &'a [ArgMapping]
Resolve the effective args for this fixture, preferring fixture-level args when present.
When self.args is non-empty, returns a reference to it. Otherwise, returns
a reference to call_config.args. This allows fixtures to override the call’s
default args (e.g., for trait-bridge stubs that need per-fixture test backend setup).
Sourcepub fn is_http_test(&self) -> bool
pub fn is_http_test(&self) -> bool
Returns true if this is an HTTP server test fixture.
Sourcepub fn needs_mock_server(&self) -> bool
pub fn needs_mock_server(&self) -> bool
Returns true if this fixture requires a mock HTTP server.
This is true when the fixture declares a single mock response, an HTTP expected
response, or one or more entries in the generic input.mock_responses route array.
Sourcepub fn as_mock_response(&self) -> Option<MockResponse>
pub fn as_mock_response(&self) -> Option<MockResponse>
Returns the effective mock response for this fixture, bridging both schemas:
- call fixture schema:
mock_response: { status, body, stream_chunks } - HTTP fixture schema:
http.expected_response: { status_code, body, headers }
Returns None if neither schema is present.
Sourcepub fn is_streaming_mock(&self) -> bool
pub fn is_streaming_mock(&self) -> bool
Returns true if the mock response uses streaming (SSE).
Sourcepub fn has_host_root_route(&self) -> bool
pub fn has_host_root_route(&self) -> bool
Returns true if this fixture needs a dedicated origin-root listener.
Route-array fixtures are normally mounted under /fixtures/<id> in the shared
mock server. A dedicated listener is required when a route path or fixture body
makes the client under test resolve follow-up requests from the origin root rather
than the fixture namespace. Mirrors the is_host_root_path predicate in the
standalone mock-server binary (codegen/rust/mock_server.rs).
Origin-root fixtures get a dedicated per-fixture listener and their base URL is
published in the MOCK_SERVERS={"fixture_id":"http://..."} JSON line.
Sourcepub fn resolved_category(&self) -> String
pub fn resolved_category(&self) -> String
Get the resolved category (explicit or from source directory).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Fixture
impl<'de> Deserialize<'de> for Fixture
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Fixture
impl RefUnwindSafe for Fixture
impl Send for Fixture
impl Sync for Fixture
impl Unpin for Fixture
impl UnsafeUnpin for Fixture
impl UnwindSafe for Fixture
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more