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

testsupport

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Identity added in v0.2.4

Identity composes the identity service with the stored settings loaded, as a server replica does before serving.

func PutSettings added in v0.2.4

func PutSettings(t testing.TB, store identityservice.Store, settings identityservice.Settings)

PutSettings stores app settings, as an admin does in the console.

func RemoteAccount added in v0.2.2

func RemoteAccount(t testing.TB, store AccountStore, name string) identityservice.Account

RemoteAccount creates a Google member account with email name@example.com, as an accepted invite does.

func RemoteAdmin added in v0.2.2

func RemoteAdmin(t testing.TB, store identityservice.Store, email, password string) identityservice.Session

RemoteAdmin stores a password admin for tests unrelated to first-admin setup.

func RemotePasswordAccount added in v0.2.5

func RemotePasswordAccount(t testing.TB, store identityservice.Store, email, password string) identityservice.Account

RemotePasswordAccount stores a password account with a canonical email, bypassing admission settings, for tests unrelated to signup.

func RemoteSession added in v0.2.2

Types

type AccountStore added in v0.2.2

type AccountStore interface {
	CreateGoogleAccount(ctx context.Context, account identityservice.Account, identity google.Identity, now time.Time, required identityservice.Settings) error
}

AccountStore creates accounts directly; server storage implements it.

type Client

type Client struct {
	*ingestion.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint, token string) *Client

func (*Client) Submit

func (client *Client) Submit(ctx context.Context, input ingestion.Request) (Receipt, error)

func (*Client) SubmitTo

func (client *Client) SubmitTo(ctx context.Context, input ingestion.Request, state string) (Receipt, error)

type PushDevice added in v0.2.2

type PushDevice struct {
	Private *ecdh.PrivateKey
	Auth    []byte
}

PushDevice is a browser push subscription's receiving keys.

func NewPushDevice added in v0.2.2

func NewPushDevice(t testing.TB) PushDevice

NewPushDevice generates receiving keys, as a browser does when subscribing.

func (PushDevice) AuthSecret added in v0.2.2

func (device PushDevice) AuthSecret() string

func (PushDevice) Decrypt added in v0.2.2

func (device PushDevice) Decrypt(t testing.TB, body []byte) []byte

Decrypt opens an RFC 8291 aes128gcm message body with a single record, as the browser's push stack does before the service worker sees the payload.

func (PushDevice) P256dh added in v0.2.2

func (device PushDevice) P256dh() string

P256dh and AuthSecret are the base64url keys of PushSubscription.toJSON().

type Receipt

type Receipt struct {
	ingestion.Receipt
	Snapshot review.RepositoryDiff
}

type TestServer

type TestServer struct {
	*httptest.Server
	// contains filtered or unexported fields
}

func Server

Server composes an unauthenticated queue and worker for producer integration tests.

func (*TestServer) Close

func (server *TestServer) Close()

Directories

Path Synopsis
Package pgtest gives each test its own migrated Postgres database.
Package pgtest gives each test its own migrated Postgres database.

Jump to

Keyboard shortcuts

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