pub struct CustomConformanceConfig {
pub custom_checks: Vec<CustomCheck>,
pub chain_iterations: u32,
}Expand description
Top-level YAML configuration for custom conformance checks
Fields§
§custom_checks: Vec<CustomCheck>List of custom checks to run
chain_iterations: u32Round 38 (#79) — Srikanth on 0.3.182. Repeat the entire
custom_checks sequence N times so a “log in, do work,
log out” chain can be exercised under load. The
${var:...} / ${cookie:...} substitution context is
reset at the start of each iteration; values captured in
iteration K are NOT visible to iteration K+1. Defaults to 1.
Implementations§
Source§impl CustomConformanceConfig
impl CustomConformanceConfig
Sourcepub fn from_file(path: &Path) -> Result<Self>
pub fn from_file(path: &Path) -> Result<Self>
Parse a custom conformance config from a YAML file
Sourcepub fn generate_k6_group(
&self,
base_url: &str,
custom_headers: &[(String, String)],
) -> String
pub fn generate_k6_group( &self, base_url: &str, custom_headers: &[(String, String)], ) -> String
Generate a k6 group('Custom', ...) block for all custom checks.
base_url is the JS expression for the base URL (e.g., "BASE_URL").
custom_headers are additional headers to inject into every request.
Sourcepub fn emit_k6_with_options(
&self,
base_url: &str,
custom_headers: &[(String, String)],
export_requests: bool,
) -> K6CustomEmit
pub fn emit_k6_with_options( &self, base_url: &str, custom_headers: &[(String, String)], export_requests: bool, ) -> K6CustomEmit
Round 39 (#79) — splits the k6 emit into the init-scope code
(open(...) calls for file uploads) and the per-VU group body
(the group('Custom', ...) block). Caller is responsible for
placing init_code at the top of the script (before
export default function) and group_body inside the default
function. For backwards compatibility, generate_k6_group and
generate_k6_group_with_options concatenate the two so existing
code paths keep working — but they will emit the open() calls
inside the VU function, which k6 rejects at runtime for
uploads. Use emit_k6_with_options directly when uploads are
expected.
Sourcepub fn generate_k6_group_with_options(
&self,
base_url: &str,
custom_headers: &[(String, String)],
export_requests: bool,
) -> String
pub fn generate_k6_group_with_options( &self, base_url: &str, custom_headers: &[(String, String)], export_requests: bool, ) -> String
Generate a k6 group('Custom', ...) block for all custom checks.
When export_requests is true, emits __captureExchange calls after each request.
Round 39 (#79) — file uploads need open() at init scope, so
callers that may receive an upload/uploads YAML should
switch to emit_k6_with_options and splice init_code
separately. This method is kept for backwards compatibility
and concatenates init + body — which crashes k6 at runtime when
uploads are configured.
Trait Implementations§
Source§impl Debug for CustomConformanceConfig
impl Debug for CustomConformanceConfig
Source§impl<'de> Deserialize<'de> for CustomConformanceConfig
impl<'de> Deserialize<'de> for CustomConformanceConfig
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 CustomConformanceConfig
impl RefUnwindSafe for CustomConformanceConfig
impl Send for CustomConformanceConfig
impl Sync for CustomConformanceConfig
impl Unpin for CustomConformanceConfig
impl UnsafeUnpin for CustomConformanceConfig
impl UnwindSafe for CustomConformanceConfig
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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