pub struct TestHistory { /* private fields */ }Expand description
Test history store backed by JSON files.
Implementations§
Source§impl TestHistory
impl TestHistory
Sourcepub fn new_in_memory() -> Self
pub fn new_in_memory() -> Self
Create a new in-memory history (for testing).
Sourcepub fn record(&mut self, result: &TestRunResult) -> Result<()>
pub fn record(&mut self, result: &TestRunResult) -> Result<()>
Record a test run result.
Sourcepub fn recent_runs(&self, n: usize) -> &[RunRecord]
pub fn recent_runs(&self, n: usize) -> &[RunRecord]
Get the most recent N runs.
Sourcepub fn get_trend(&self, test_name: &str, last_n: usize) -> Vec<TestTrend>
pub fn get_trend(&self, test_name: &str, last_n: usize) -> Vec<TestTrend>
Get trend data for a specific test.
Sourcepub fn get_flaky_tests(
&self,
min_runs: usize,
max_pass_rate: f64,
) -> Vec<FlakyTest>
pub fn get_flaky_tests( &self, min_runs: usize, max_pass_rate: f64, ) -> Vec<FlakyTest>
Get flaky tests (tests that alternate between pass and fail).
Sourcepub fn get_slowest_trending(
&self,
last_n: usize,
min_runs: usize,
) -> Vec<SlowTest>
pub fn get_slowest_trending( &self, last_n: usize, min_runs: usize, ) -> Vec<SlowTest>
Get tests that are getting slower over time.
Sourcepub fn prune(&mut self, keep: usize) -> Result<usize>
pub fn prune(&mut self, keep: usize) -> Result<usize>
Prune old entries, keeping only the most recent N.
Sourcepub fn avg_duration(&self, last_n: usize) -> Duration
pub fn avg_duration(&self, last_n: usize) -> Duration
Get the average duration over recent runs.
Auto Trait Implementations§
impl Freeze for TestHistory
impl RefUnwindSafe for TestHistory
impl Send for TestHistory
impl Sync for TestHistory
impl Unpin for TestHistory
impl UnsafeUnpin for TestHistory
impl UnwindSafe for TestHistory
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
Mutably borrows from an owned value. Read more