Documentation
¶
Overview ¶
Package testkit holds the helpers tests share: creating the bootstrap admin user and her token directly in the database. Tests do not spend password-login throttle budgets to bootstrap themselves.
Index ¶
Constants ¶
const DatabaseEnv = "LIC_TEST_DATABASE_URL"
DatabaseEnv names the PostgreSQL server of the live tests.
Variables ¶
This section is empty.
Functions ¶
func Database ¶ added in v0.0.5
Database answers the DSN of a fresh database on the live-test server, dropped when the test ends. Tests that run an outbox relay or read rows across accounts get one each, so concurrent packages share no queue. It skips the test without DatabaseEnv.
func SeedAdmin ¶
func SeedAdmin(ctx context.Context, db *postgres.Store, accountID uuid.UUID, email string) (string, error)
SeedAdmin creates the account's bootstrap admin user when her email is not taken (idempotent per email) and answers the raw secret of an admin token issued directly in the database, independently of Basic authentication or its throttle.
Types ¶
This section is empty.