Skip to main content

Crate skipper_core

Crate skipper_core 

Source
Expand description

Core of Skipper: test-gating via Google Spreadsheet.

Most users want the get-skipper crate (the #[skipper] attribute) or skipper-cucumber. This crate holds the shared pieces: the resolver, the Google Sheets client, the sync writer, caches and the quarantine report.

Structs§

CacheManager
Temp directory shared between the orchestrating process (cargo skipper) and the test binaries: it holds the resolver handoff (cache.json) and one JSON array of discovered test IDs per writer.
Error
Error type for every fallible Skipper operation.
FetchAllResult
The primary sheet plus all entries merged with the reference sheets.
HttpSheetsApi
Sheets API over HTTPS, authenticated with a service-account JWT (OAuth 2.0 jwt-bearer grant). The access token is cached until shortly before it expires.
Report
Quarantine-debt summary emitted at the end of a run.
ServiceAccountCredentials
The fields of a Google service-account JSON key.
SheetFetchResult
A single fetched sheet.
SheetsWriter
Reconciles the primary sheet with the test IDs discovered in a run: new IDs are appended (empty disabledUntil); stale rows of the same files are deleted only with SKIPPER_SYNC_ALLOW_DELETE=true. Existing rows are never modified.
SkipperConfig
Configuration shared by the resolver and the writer.
SkipperResolver
Decides whether a test runs. Tests not in the spreadsheet always run (opt-out model); a test with a future disabledUntil is skipped.
TestEntry
One spreadsheet row.

Enums§

Credentials
Google service-account credentials, in one of three formats.
SkipperMode
Operating mode, read from SKIPPER_MODE.

Traits§

SheetsApi
The four Google Sheets v4 calls Skipper needs. Implemented over HTTP by HttpSheetsApi; tests can provide an in-memory fake.

Functions§

build_markdown_summary
build_report
entries: resolver state; suppressed: IDs skipped in this run; re_enabled: IDs that ran although listed with an already expired date.
build_test_id
relative/path.rs > part1 > part2. The path is made relative to the project root (see find_project_root) and always uses /.
debug_enabled
True when SKIPPER_DEBUG is set to a non-empty value.
emit_summary
Append the markdown to $GITHUB_STEP_SUMMARY (else print it to stdout) and write skipper-report.json in the current directory.
fetch_all
Fetch the primary sheet and merge every reference sheet into it. A failing reference sheet is skipped with a warning; a failing primary is an error.
find_project_root
Outermost ancestor whose Cargo.toml declares [workspace], else the nearest directory with a Cargo.toml, else start itself.
log
Debug log to stderr, only when SKIPPER_DEBUG is set.
normalize_test_id
Canonical form used for every lookup: trim, lowercase, collapse whitespace.
parse_disabled_until
Parse a disabledUntil cell. Only strict YYYY-MM-DD is accepted; the result is midnight UTC of the following day, so the test stays disabled for the whole calendar day. Empty means no date. row (1-based sheet row, 0 = unknown) only appears in the error message.
relative_to_root
Make file relative to the project root. Relative paths (what file!() yields for workspace members) are kept as they are.
warn
Warning to stderr, only when SKIPPER_DEBUG is set.

Type Aliases§

Result