test

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Begin

Begin returns the shared test manager, which is listening, and a per-test context

func Conn

func Conn() pg.PoolConn

Conn returns the connection to the test database, for tests which create managers of their own

func End

func End(t *testing.T)

End releases the per-test context created by Begin

func Logs

func Logs() string

Logs returns what the shared manager has logged

func Main

func Main(m *testing.M, opts ...broadcaster.Opt)

Main initializes a PostgreSQL pool, and a manager, on a channel of its own, whose event loop runs, logging to the log which Logs returns, before running the tests. If PGBROADCASTER_TEST_DATABASE_URL is set, it connects to that server; otherwise it starts a PostgreSQL container.

func Start

func Start(conn pg.PoolConn, opts ...broadcaster.Opt) (*broadcaster.Manager, func() error, error)

Start creates a manager on a channel of its own, so the tests of a package don't hear those of others which run at the same time against the same database, with the options, which can still set the channel, and runs it, until the returned function stops it, once it's listening. It's for the tests of the modules which listen with a broadcaster.

Types

This section is empty.

Jump to

Keyboard shortcuts

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