pub struct TestExecutionContext {Show 13 fields
pub test_name: String,
pub test_suite: String,
pub test_isolated: bool,
pub test_result: TestResult,
pub test_duration_ms: f64,
pub test_start_timestamp: i64,
pub test_end_timestamp: i64,
pub container_info: Option<ContainerInfo>,
pub error_type: Option<String>,
pub error_message: Option<String>,
pub assertion_count: Option<u32>,
pub cleanup_performed: bool,
pub plugin_execution_time_ms: Option<f64>,
}Expand description
Complete test execution context with ALL schema attributes
Fields§
§test_name: Stringtest.name (required)
test_suite: Stringtest.suite (required)
test_isolated: booltest.isolated (required, must be true for clnrm)
test_result: TestResulttest.result (required)
test_duration_ms: f64test.duration_ms (required, must be > 0)
test_start_timestamp: i64test.start_timestamp (Unix timestamp in milliseconds)
test_end_timestamp: i64test.end_timestamp (Unix timestamp in milliseconds)
container_info: Option<ContainerInfo>container.id (required - CRITICAL PROOF)
error_type: Option<String>error.type (conditionally required when result is ‘error’)
error_message: Option<String>error.message (conditionally required when result is ‘fail’ or ‘error’)
assertion_count: Option<u32>test.assertion_count (recommended)
cleanup_performed: booltest.cleanup_performed (required, must be true)
plugin_execution_time_ms: Option<f64>plugin.execution_time_ms (recommended)
Implementations§
Source§impl TestExecutionContext
impl TestExecutionContext
Sourcepub fn new(test_name: String, test_suite: String) -> Self
pub fn new(test_name: String, test_suite: String) -> Self
Create a new test execution context with required fields
Sourcepub fn with_container(self, container: ContainerInfo) -> Self
pub fn with_container(self, container: ContainerInfo) -> Self
Set container information (CRITICAL for validation)
Sourcepub fn with_result(self, result: TestResult, duration: Duration) -> Self
pub fn with_result(self, result: TestResult, duration: Duration) -> Self
Set test result and timestamps
Sourcepub fn with_error(self, error_type: String, error_message: String) -> Self
pub fn with_error(self, error_type: String, error_message: String) -> Self
Set error information (for fail/error results)
Sourcepub fn with_cleanup(self, performed: bool) -> Self
pub fn with_cleanup(self, performed: bool) -> Self
Set cleanup status
Sourcepub fn with_assertions(self, count: u32) -> Self
pub fn with_assertions(self, count: u32) -> Self
Set assertion count
Sourcepub fn with_plugin_time(self, time_ms: f64) -> Self
pub fn with_plugin_time(self, time_ms: f64) -> Self
Set plugin execution time
Trait Implementations§
Source§impl Clone for TestExecutionContext
impl Clone for TestExecutionContext
Source§fn clone(&self) -> TestExecutionContext
fn clone(&self) -> TestExecutionContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TestExecutionContext
impl RefUnwindSafe for TestExecutionContext
impl Send for TestExecutionContext
impl Sync for TestExecutionContext
impl Unpin for TestExecutionContext
impl UnwindSafe for TestExecutionContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request