Documentation
¶
Overview ¶
Package cloudtest exposes test-only helpers for the “cloud“ package. Lives in a sibling subpackage so the production-compiled “internal/cloud“ package has no “testing“ import and doesn't leak test flags (“-test.v“, “-test.run“, etc.) into the sx binary.
Only call site is test files in neighbouring packages (e.g. “internal/commands“). Tests inside “internal/cloud“ itself use the package-scoped helpers in “credential_test.go“ directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keyring ¶
type Keyring struct {
// contains filtered or unexported fields
}
Keyring is an in-memory “cloud.TokenStore“ for use in tests that exercise the credential layer end-to-end. Methods mirror the “cloud.TokenStore“ interface; “Entries“ returns a snapshot of the current contents for assertions.
func InstallKeyring ¶
InstallKeyring replaces the cloud package's active token store with a fresh in-memory Keyring for the duration of one test, restoring the previous store on cleanup.
func (*Keyring) Entries ¶
Entries returns a snapshot of the keyring contents. Safe to call concurrently with the production code under test.