Help us shape the future of Go! Take the 2026 Go Developer Survey

platformtest

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package platformtest runs a real workspace platform for tests of its clients: the CLI and the agent. Sign-in runs inside it (at /auth), so its codes and its invites land in one Inbox. It needs PostgreSQL from pgtest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inbox

type Inbox struct {
	// contains filtered or unexported fields
}

Inbox keeps the emails the platform sends: sign-in codes and invites.

func (*Inbox) Code

func (b *Inbox) Code(t testing.TB, to string, n int) string

Code waits for the n-th code (from 1) sent to an address and returns it.

func (*Inbox) Count

func (b *Inbox) Count(to string) int

Count is how many codes went to an address.

func (*Inbox) Invites

func (b *Inbox) Invites(to string) []string

Invites are the texts of the invites sent to an address.

func (*Inbox) Send

func (b *Inbox) Send(_ context.Context, m mail.Message) error

type Platform

type Platform struct {
	URL     string
	Service *platform.Service
	Inbox   *Inbox
	// Close stops it before the test ends: an agent then works without it.
	Close func()
}

Platform is a platform on a test HTTP server.

func Start

func Start(t testing.TB, workspace, owner string) *Platform

Start runs the platform of a workspace with its owner on a fresh database; it skips without PostgreSQL.

func StartWith

func StartWith(t testing.TB, workspace, owner string, ext platform.Extensions) *Platform

StartWith is Start with extensions: a policy that limits, a plan to show.

Jump to

Keyboard shortcuts

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