testutils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 26 Imported by: 0 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

View Source
var TestAssets embed.FS

Functions

func ArrayToPool

func ArrayToPool(array []string)

func GenerateDBAuthor

func GenerateDBAuthor() db.AuthorDB

func GetTestAssets

func GetTestAssets() embed.FS

func RunSequentialMemorySQLite added in v0.6.8

func RunSequentialMemorySQLite(t *testing.T, conf TestRunConfig)

RunSequentialMemorySQLite runs conf against the in-process datastores only (Memory and SQLite), for tests that don't need the SQL servers.

Types

type TestDBHandler

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

func NewTestDBHandler

func NewTestDBHandler(t *testing.T) *TestDBHandler

func (*TestDBHandler) AddTests

func (test *TestDBHandler) AddTests(testConfs ...TestRunConfig)

func (*TestDBHandler) StartTestDBHandler

func (test *TestDBHandler) StartTestDBHandler()

func (*TestDBHandler) TestRun

func (test *TestDBHandler) TestRun(
	t *testing.T,
	testRun TestRunConfig,
	newDS func(t *testing.T) db.DataStore,
	dsName string,
)

type TestDataStore

type TestDataStore struct {
	DS                  db.DataStore
	Logger              *zap.SugaredLogger
	Hooks               *hooks2.Hook
	ReadOnlyManager     *pad.ReadOnlyManager
	SecurityManager     *pad.SecurityManager
	AuthorManager       *author.Manager
	PadManager          *pad.Manager
	PadMessageHandler   *ws.PadMessageHandler
	AdminMessageHandler *ws.AdminMessageHandler
	MockWebSocket       *ws.MockWebSocketConn
	Validator           *validator.Validate
	Hub                 *ws.Hub
	App                 *fiber.App
	PrivateAPI          fiber.Router
	Importer            *io.Importer
	// Settings is this test's own copy of the settings. The SecurityManager
	// and the InitStore read it, so a test may change it without affecting
	// tests running in parallel.
	Settings *settings.Settings
}

func (*TestDataStore) ToInitStore

func (t *TestDataStore) ToInitStore() *lib.InitStore

func (*TestDataStore) ToPluginStore added in v0.0.5

func (t *TestDataStore) ToPluginStore() *interfaces.EpPluginStore

type TestRunConfig

type TestRunConfig struct {
	Name string
	Test func(t *testing.T, tsStore TestDataStore)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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