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 earlyreturn(useskip_if_disabled!(Ok(()))in tests returningResult).
Structs§
- Cache
Manager - 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.
- Fetch
AllResult - The primary sheet plus all entries merged with the reference sheets.
- Http
Sheets Api - Sheets API over HTTPS, authenticated with a service-account JWT
(OAuth 2.0
jwt-bearergrant). The access token is cached until shortly before it expires. - Report
- Quarantine-debt summary emitted at the end of a run.
- Service
Account Credentials - The fields of a Google service-account JSON key.
- Sheet
Fetch Result - A single fetched sheet.
- Sheets
Writer - 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 withSKIPPER_SYNC_ALLOW_DELETE=true. Existing rows are never modified. - Skipper
Config - Configuration shared by the resolver and the writer.
- Skipper
Resolver - Decides whether a test runs. Tests not in the spreadsheet always run
(opt-out model); a test with a future
disabledUntilis skipped. - Test
Entry - One spreadsheet row.
Enums§
- Credentials
- Google service-account credentials, in one of three formats.
- Skipper
Mode - Operating mode, read from
SKIPPER_MODE.
Traits§
- Sheets
Api - 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 (seefind_project_root) and always uses/.- debug_
enabled - True when
SKIPPER_DEBUGis set to a non-empty value. - emit_
summary - Append the markdown to
$GITHUB_STEP_SUMMARY(else print it to stdout) and writeskipper-report.jsonin 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.tomldeclares[workspace], else the nearest directory with aCargo.toml, elsestartitself. - log
- Debug log to stderr, only when
SKIPPER_DEBUGis set. - normalize_
test_ id - Canonical form used for every lookup: trim, lowercase, collapse whitespace.
- parse_
disabled_ until - Parse a
disabledUntilcell. Only strictYYYY-MM-DDis 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
filerelative to the project root. Relative paths (whatfile!()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_DEBUGis set.
Type Aliases§
Attribute Macros§
- skipper
- Skip the test when it is disabled in the Skipper spreadsheet.