Documentation
¶
Index ¶
- type Fixture
- func (f *Fixture) ExternalURL() string
- func (f *Fixture) NewClient(t *testing.T, token string) *client.Client
- func (f *Fixture) NewSuperuser(t *testing.T) (*database.User, *client.Client)
- func (f *Fixture) NewUser(t *testing.T) (*database.User, *client.Client)
- func (f *Fixture) NewUserWithDomain(t *testing.T, domain string) (*database.User, *client.Client)
- func (f *Fixture) NewUserWithEmail(t *testing.T, emailAddr string) (*database.User, *client.Client)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fixture ¶
Fixture is a test fixture for an admin service and server. It wraps an admin service with a server running on a random port backed by a testcontainer Postgres database. The service, server and other resources will be cleaned up when the test that created the Fixture stops.
The service has several limitations compared to a production server: - Cannot provision runtimes - Github operation are no-ops - Billing operations are no-ops - No configured metrics project - Does not run background jobs
func New ¶
New creates an ephemeral admin service and server for testing. See the docstring for the returned Fixture for details.
func (*Fixture) ExternalURL ¶
ExternalURL returns the localhost URL of the fixture's server.
func (*Fixture) NewSuperuser ¶
NewSuperuser creates a new user with superuser permission in the fixture's admin service.
func (*Fixture) NewUserWithDomain ¶
NewUserWithDomain creates a new user with a random email with the given email domain in the fixture's admin service.