Skip to main content

Crate get_skipper

Crate get_skipper 

Source
Expand description

Skipper for Rust: enable or disable tests from a Google Spreadsheet.

ⓘ
use get_skipper::skipper;

#[skipper]
#[test]
fn can_log_in() { /* … */ }

Configure with environment variables (SKIPPER_SPREADSHEET_ID, GOOGLE_CREDS_B64 or SKIPPER_CREDENTIALS_FILE, SKIPPER_SHEET_NAME), e.g. in .cargo/config.toml under [env]. Without them every test runs. Run through cargo skipper test (crate cargo-skipper) to fetch the sheet once per run, get the quarantine report and use SKIPPER_MODE=sync.

Macros§

skip_if_disabled
Skip the current test if it is disabled. For code where the #[skipper] attribute cannot go; must be called directly in the test function body. Expands to an early return (use skip_if_disabled!(Ok(())) in tests returning Result).

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.
test_id
Test ID used by #[skipper]: file > module::path > fn (crate name dropped).
warn
Warning to stderr, only when SKIPPER_DEBUG is set.

Type Aliases§

Result

Attribute Macros§

skipper
Skip the test when it is disabled in the Skipper spreadsheet.