testkit

package
v0.0.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 14 Imported by: 0

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

View Source
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

func Database(ctx context.Context, tb testing.TB) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL