pub struct ToolExecutor { /* private fields */ }Expand description
APR Tool test executor for comprehensive tool coverage
Implementations§
Source§impl ToolExecutor
impl ToolExecutor
Sourcepub fn new(model_path: String, no_gpu: bool, timeout_ms: u64) -> Self
pub fn new(model_path: String, no_gpu: bool, timeout_ms: u64) -> Self
Create a new tool executor
Sourcepub fn with_runner(
model_path: String,
no_gpu: bool,
timeout_ms: u64,
runner: Arc<dyn CommandRunner>,
) -> Self
pub fn with_runner( model_path: String, no_gpu: bool, timeout_ms: u64, runner: Arc<dyn CommandRunner>, ) -> Self
Create a new tool executor with custom command runner
Sourcepub fn execute_inspect(&self) -> ToolTestResult
pub fn execute_inspect(&self) -> ToolTestResult
Execute apr rosetta inspect (works with any format)
Sourcepub fn execute_inspect_verified(&self) -> ToolTestResult
pub fn execute_inspect_verified(&self) -> ToolTestResult
Execute apr rosetta inspect with metadata verification (T-GH192-01)
Parses --json output and validates that critical model metadata
fields are present and non-zero. This catches models with missing
or corrupted config (e.g., num_heads=0, hidden_size=0).
Gate: F-INSPECT-META-001
Sourcepub fn execute_validate(&self) -> ToolTestResult
pub fn execute_validate(&self) -> ToolTestResult
Execute apr validate
Sourcepub fn execute_bench(&self) -> ToolTestResult
pub fn execute_bench(&self) -> ToolTestResult
Execute apr bench
Sourcepub fn execute_check(&self) -> ToolTestResult
pub fn execute_check(&self) -> ToolTestResult
Execute apr check
Sourcepub fn execute_trace(&self, level: &str) -> ToolTestResult
pub fn execute_trace(&self, level: &str) -> ToolTestResult
Execute apr trace with specified level
Sourcepub fn execute_profile(&self) -> ToolTestResult
pub fn execute_profile(&self) -> ToolTestResult
Execute apr profile (standalone command)
Sourcepub fn execute_profile_ci(&self) -> ToolTestResult
pub fn execute_profile_ci(&self) -> ToolTestResult
Execute apr profile in CI mode with assertions (F-PROFILE-006)
Tests the CI mode features:
--ciflag for CI mode with assertion checks--assert-throughputminimum tok/s assertion--warmupand--measurepass counts
Returns pass if CI mode runs and reports metrics correctly.
Sourcepub fn execute_profile_ci_assertion_failure(&self) -> ToolTestResult
pub fn execute_profile_ci_assertion_failure(&self) -> ToolTestResult
Execute apr profile CI with assertion failure test (F-PROFILE-007)
Tests that CI mode correctly fails when assertions are not met. Uses an impossibly high throughput assertion to guarantee failure.
Sourcepub fn execute_profile_ci_p99(&self) -> ToolTestResult
pub fn execute_profile_ci_p99(&self) -> ToolTestResult
Execute apr profile with p99 latency assertion (F-PROFILE-008)
Sourcepub fn execute_profile_flamegraph(&self, output_path: &Path) -> ToolTestResult
pub fn execute_profile_flamegraph(&self, output_path: &Path) -> ToolTestResult
Execute apr profile with flamegraph output (F-PROFILE-002)
Tests that profile can generate valid SVG flamegraph output. This feature may not be available in all apr versions.
Sourcepub fn execute_profile_focus(&self, focus: &str) -> ToolTestResult
pub fn execute_profile_focus(&self, focus: &str) -> ToolTestResult
Execute apr profile with focus filtering (F-PROFILE-003)
Tests that profile –focus option works to limit scope. This feature may not be available in all apr versions.
Sourcepub fn execute_backend_equivalence(&self) -> ToolTestResult
pub fn execute_backend_equivalence(&self) -> ToolTestResult
Execute backend equivalence test (F-CONV-BE-001)
Compares CPU vs GPU output to verify they produce equivalent results. Skips if GPU is not available.
Sourcepub fn execute_serve_lifecycle(&self) -> ToolTestResult
pub fn execute_serve_lifecycle(&self) -> ToolTestResult
Execute apr serve lifecycle test (F-INTEG-003)
Tests the full serve lifecycle:
- Start server
- Wait for health endpoint
- Make inference request
- Shutdown cleanly
Sourcepub fn execute_all(&self) -> Vec<ToolTestResult>
pub fn execute_all(&self) -> Vec<ToolTestResult>
Execute all tool tests
Sourcepub fn execute_all_with_serve(&self, include_serve: bool) -> Vec<ToolTestResult>
pub fn execute_all_with_serve(&self, include_serve: bool) -> Vec<ToolTestResult>
Execute all tool tests, optionally including serve lifecycle
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolExecutor
impl !RefUnwindSafe for ToolExecutor
impl Send for ToolExecutor
impl Sync for ToolExecutor
impl Unpin for ToolExecutor
impl !UnwindSafe for ToolExecutor
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> 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