test

package
v1.4.3-prerelease09 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 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

This section is empty.

Types

type DB

type DB interface {
	schema.SchemaClient
	CreateDatabase(name string) error
	DropDatabase(name string) error
	ListTables() ([]string, error)
}

DB is a test interface for a database that supports schema tool

type DBTestBase

type DBTestBase struct {
	suite.Suite
	*require.Assertions
	Log    log.Logger
	DBName string
	// contains filtered or unexported fields
}

DBTestBase is the base for all test suites that test the functionality of a DB implementation

func (*DBTestBase) RunCreateTest

func (tb *DBTestBase) RunCreateTest(db DB)

RunCreateTest tests schema version table creation

func (*DBTestBase) RunDropTest

func (tb *DBTestBase) RunDropTest(db DB)

RunDropTest tests the drop methods in DB implementation

func (*DBTestBase) RunParseFileTest

func (tb *DBTestBase) RunParseFileTest(content string)

RunParseFileTest runs a test against the ParseFile method

func (*DBTestBase) RunUpdateTest

func (tb *DBTestBase) RunUpdateTest(db DB)

RunUpdateTest tests update of schema and schema version tables

func (*DBTestBase) SetupSuiteBase

func (tb *DBTestBase) SetupSuiteBase(db DB)

SetupSuiteBase sets up the test suite

func (*DBTestBase) TearDownSuiteBase

func (tb *DBTestBase) TearDownSuiteBase()

TearDownSuiteBase tears down the test suite

type SetupSchemaTestBase

type SetupSchemaTestBase struct {
	suite.Suite
	*require.Assertions

	Log    log.Logger
	DBName string
	// contains filtered or unexported fields
}

SetupSchemaTestBase is the base test suite for all tests that exercise schema setup using the schema tool

func (*SetupSchemaTestBase) RunSetupTest

func (tb *SetupSchemaTestBase) RunSetupTest(
	app *cli.App, db DB, dbNameFlag string, sqlFileContent string, expectedTables []string)

RunSetupTest exercises the SetupSchema task

func (*SetupSchemaTestBase) SetupSuiteBase

func (tb *SetupSchemaTestBase) SetupSuiteBase(db DB)

SetupSuiteBase sets up the test suite

func (*SetupSchemaTestBase) TearDownSuiteBase

func (tb *SetupSchemaTestBase) TearDownSuiteBase()

TearDownSuiteBase tears down the test suite

type UpdateSchemaTestBase

type UpdateSchemaTestBase struct {
	suite.Suite
	*require.Assertions

	Log    log.Logger
	DBName string
	// contains filtered or unexported fields
}

UpdateSchemaTestBase is the base test suite for all tests that exercise schema update using the schema tool

func (*UpdateSchemaTestBase) RunDryrunTest

func (tb *UpdateSchemaTestBase) RunDryrunTest(app *cli.App, db DB, dbNameFlag string, dir string, endVersion string)

RunDryrunTest tests a dryrun schema setup & update

func (*UpdateSchemaTestBase) RunUpdateSchemaTest

func (tb *UpdateSchemaTestBase) RunUpdateSchemaTest(app *cli.App, db DB, dbNameFlag string, sqlFileContent string, expectedTables []string)

RunUpdateSchemaTest tests schema update

func (*UpdateSchemaTestBase) SetupSuiteBase

func (tb *UpdateSchemaTestBase) SetupSuiteBase(db DB)

SetupSuiteBase sets up the test suite

func (*UpdateSchemaTestBase) TearDownSuiteBase

func (tb *UpdateSchemaTestBase) TearDownSuiteBase()

TearDownSuiteBase tears down the test suite

Jump to

Keyboard shortcuts

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