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<Self>
pub fn initialize(config: &SkipperConfig) -> Result<Self>
Fetch the spreadsheet once. See SkipperResolver::initialize_with
for the fallback rules.
Sourcepub fn initialize_with(
fetch: impl FnOnce() -> Result<Vec<TestEntry>>,
) -> Result<Self>
pub fn initialize_with( fetch: impl FnOnce() -> Result<Vec<TestEntry>>, ) -> Result<Self>
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<Self>>
pub fn from_env() -> Result<Option<Self>>
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>>
pub fn marshal_cache(&self) -> Result<Vec<u8>>
Serialize for the main-process → test-binary handoff
(SKIPPER_WORKER_CACHE_FILE).