pub struct SkipperResolver { /* private fields */ }Expand description
Decides whether a test runs. Tests not in the spreadsheet always run
(opt-out model); a test with a future disabledUntil is skipped.
Implementations§
Source§impl SkipperResolver
impl SkipperResolver
Sourcepub fn initialize(config: &SkipperConfig) -> Result<SkipperResolver, Error>
pub fn initialize(config: &SkipperConfig) -> Result<SkipperResolver, Error>
Fetch the spreadsheet once. See SkipperResolver::initialize_with
for the fallback rules.
Sourcepub fn initialize_with(
fetch: impl FnOnce() -> Result<Vec<TestEntry>, Error>,
) -> Result<SkipperResolver, Error>
pub fn initialize_with( fetch: impl FnOnce() -> Result<Vec<TestEntry>, Error>, ) -> Result<SkipperResolver, Error>
Build the resolver from fetch. If it fails: use the disk cache
(SKIPPER_CACHE_FILE, default .skipper-cache.json) when it is younger
than SKIPPER_CACHE_TTL seconds (default 300, 0 disables it); else,
with SKIPPER_FAIL_OPEN (default true), run every test; else error.
Sourcepub fn from_env() -> Result<Option<SkipperResolver>, Error>
pub fn from_env() -> Result<Option<SkipperResolver>, Error>
Resolver for a test process: rehydrate from SKIPPER_WORKER_CACHE_FILE
(written by cargo skipper) or fetch with SkipperConfig::from_env.
Ok(None) when Skipper is not configured (every test runs).
pub fn is_test_enabled(&self, test_id: &str) -> bool
Sourcepub fn disabled_until(&self, test_id: &str) -> Option<DateTime<Utc>>
pub fn disabled_until(&self, test_id: &str) -> Option<DateTime<Utc>>
Instant the test is re-enabled (midnight UTC after the sheet date).
Sourcepub fn skip_message(&self, test_id: &str) -> String
pub fn skip_message(&self, test_id: &str) -> String
[skipper] SKIP <id>: test disabled until <sheet date>.
Sourcepub fn entries(&self) -> &HashMap<String, Option<DateTime<Utc>>>
pub fn entries(&self) -> &HashMap<String, Option<DateTime<Utc>>>
Normalized test ID → re-enable instant (None: listed, no date).
Sourcepub fn marshal_cache(&self) -> Result<Vec<u8>, Error>
pub fn marshal_cache(&self) -> Result<Vec<u8>, Error>
Serialize for the main-process → test-binary handoff
(SKIPPER_WORKER_CACHE_FILE).
pub fn from_marshaled_cache(data: &[u8]) -> Result<SkipperResolver, Error>
Trait Implementations§
Source§impl Clone for SkipperResolver
impl Clone for SkipperResolver
Source§fn clone(&self) -> SkipperResolver
fn clone(&self) -> SkipperResolver
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more