Skipper.Resolver (skipper_core v1.0.0)

Copy Markdown View Source

Decides whether a test runs. Tests not in the spreadsheet always run (opt-out model); a test with a future disabledUntil is skipped.

Summary

Functions

Instant the test is re-enabled (midnight UTC after the sheet date), or nil.

Fetch the spreadsheet once. See initialize_with/1 for the fallback rules.

Build the resolver from fetch (returns {:ok, entries}). If it fails: use the disk cache (SKIPPER_CACHE_FILE, default .skipper-cache.json) when younger than SKIPPER_CACHE_TTL seconds (default 300, 0 disables it); else, with SKIPPER_FAIL_OPEN (default true), run every test; else error.

Add or override entries (test ID → re-enable instant). Handy in tests.

[skipper] Test disabled until <sheet date>.

Types

t()

@type t() :: %Skipper.Resolver{cache: %{required(String.t()) => DateTime.t() | nil}}

Functions

disabled_until(resolver, test_id)

Instant the test is re-enabled (midnight UTC after the sheet date), or nil.

enabled?(resolver, test_id)

@spec enabled?(t(), String.t()) :: boolean()

initialize(config)

@spec initialize(Skipper.Config.t()) :: {:ok, t()} | {:error, String.t()}

Fetch the spreadsheet once. See initialize_with/1 for the fallback rules.

initialize_with(fetch)

@spec initialize_with((-> {:ok, [Skipper.Client.entry()]} | {:error, String.t()})) ::
  {:ok, t()} | {:error, String.t()}

Build the resolver from fetch (returns {:ok, entries}). If it fails: use the disk cache (SKIPPER_CACHE_FILE, default .skipper-cache.json) when younger than SKIPPER_CACHE_TTL seconds (default 300, 0 disables it); else, with SKIPPER_FAIL_OPEN (default true), run every test; else error.

put(r, entries)

Add or override entries (test ID → re-enable instant). Handy in tests.

skip_message(resolver, test_id)

[skipper] Test disabled until <sheet date>.