tester

package
v0.0.0-...-4f35aff Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const PERM os.FileMode = 0o755

Variables

This section is empty.

Functions

func CheckEnvironment

func CheckEnvironment() error

CheckEnvironment checks if the required environment variables are set

func ExecuteTests

func ExecuteTests(
	info ClusterInfo,
	cfg Config,
	s Suite,
	factory QueryRunnerFactory,
) (failed bool)

func Run

func Run(cfg Config) error

Types

type ClusterInfo

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

func SetupCluster

func SetupCluster(cfg Config) (_ ClusterInfo, err error)

type ComparingQueryRunner

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

ComparingQueryRunner is a QueryRunner that compares the results of the queries between MySQL and Vitess

type ComparingQueryRunnerFactory

type ComparingQueryRunnerFactory struct{}

func (ComparingQueryRunnerFactory) Close

func (f ComparingQueryRunnerFactory) Close()

func (ComparingQueryRunnerFactory) NewQueryRunner

func (f ComparingQueryRunnerFactory) NewQueryRunner(reporter Reporter, handleCreateTable CreateTableHandler, comparer utils.MySQLCompare, cluster *cluster.LocalProcessCluster, vschema *vindexes.VSchema) QueryRunner

type Config

type Config struct {
	LogLevel             string
	OLAP                 bool
	Sharded              bool
	XUnit                bool
	VSchemaFile          string
	VtExplainVschemaFile string
	TraceFile            string
	Tests                []string
	NumberOfShards       int
	Compare              bool

	BackupDir string
	Loader    data.Loader
}

func (Config) GetNumberOfShards

func (cfg Config) GetNumberOfShards() int

type CreateTableHandler

type CreateTableHandler func(create *sqlparser.CreateTable) func()

type FileReporter

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

func (*FileReporter) AddFailure

func (e *FileReporter) AddFailure(err error)

func (*FileReporter) AddInfo

func (e *FileReporter) AddInfo(info string)

func (*FileReporter) AddTestCase

func (e *FileReporter) AddTestCase(query string, lineNum int)

func (*FileReporter) EndTestCase

func (e *FileReporter) EndTestCase()

func (*FileReporter) Errorf

func (e *FileReporter) Errorf(format string, args ...interface{})

func (*FileReporter) FailNow

func (e *FileReporter) FailNow()

func (*FileReporter) Failed

func (e *FileReporter) Failed() bool

func (*FileReporter) Helper

func (e *FileReporter) Helper()

func (*FileReporter) Report

func (e *FileReporter) Report() string

type FileReporterSuite

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

func NewFileReporterSuite

func NewFileReporterSuite(getVschema func() []byte) *FileReporterSuite

func (*FileReporterSuite) Close

func (frs *FileReporterSuite) Close() string

func (*FileReporterSuite) CloseReportForFile

func (frs *FileReporterSuite) CloseReportForFile()

func (*FileReporterSuite) NewReporterForFile

func (frs *FileReporterSuite) NewReporterForFile(name string) Reporter

type NullQueryRunner

type NullQueryRunner struct {
	VtConn *mysql.Conn
	// contains filtered or unexported fields
}

type NullQueryRunnerFactory

type NullQueryRunnerFactory struct{}

func (NullQueryRunnerFactory) Close

func (NullQueryRunnerFactory) Close()

func (NullQueryRunnerFactory) NewQueryRunner

type QueryRunner

type QueryRunner interface {
	// contains filtered or unexported methods
}

type QueryRunnerFactory

type QueryRunnerFactory interface {
	NewQueryRunner(reporter Reporter, handleCreateTable CreateTableHandler, comparer utils.MySQLCompare, cluster *cluster.LocalProcessCluster, vschema *vindexes.VSchema) QueryRunner
	Close()
}

type Reporter

type Reporter interface {
	utils.TestingT
	AddTestCase(query string, lineNo int)
	EndTestCase()
	AddFailure(err error)
	AddInfo(info string)
	Report() string
	Failed() bool
}

type Suite

type Suite interface {
	NewReporterForFile(name string) Reporter
	CloseReportForFile()
	Close() string // returns the path to the file or directory with files
}

type Tester

type Tester struct {
	MySQLConn, VtConn *mysql.Conn
	// contains filtered or unexported fields
}

func NewTester

func NewTester(name string, reporter Reporter, info ClusterInfo, olap bool, vschema *vindexes.VSchema, vschemaFile string, factory QueryRunnerFactory, loader data.Loader) *Tester

func (*Tester) Run

func (t *Tester) Run() (err error)

type Tracer

type Tracer struct {
	MySQLConn, VtConn *mysql.Conn
	// contains filtered or unexported fields
}

type TracerFactory

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

func NewTracerFactory

func NewTracerFactory(traceFile *os.File, inner QueryRunnerFactory) *TracerFactory

func (*TracerFactory) Close

func (t *TracerFactory) Close()

func (*TracerFactory) NewQueryRunner

func (t *TracerFactory) NewQueryRunner(reporter Reporter, handleCreateTable CreateTableHandler, comparer utils.MySQLCompare, cluster *cluster.LocalProcessCluster, vschema *vindexes.VSchema) QueryRunner

type WrongUsageError

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

func (WrongUsageError) Error

func (e WrongUsageError) Error() string

type XMLTestSuite

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

func NewXMLTestSuite

func NewXMLTestSuite() *XMLTestSuite

func (*XMLTestSuite) AddFailure

func (xml *XMLTestSuite) AddFailure(err error)

func (*XMLTestSuite) AddInfo

func (xml *XMLTestSuite) AddInfo(info string)

func (*XMLTestSuite) AddTestCase

func (xml *XMLTestSuite) AddTestCase(query string, lineNo int)

func (*XMLTestSuite) Close

func (xml *XMLTestSuite) Close() string

func (*XMLTestSuite) CloseReportForFile

func (xml *XMLTestSuite) CloseReportForFile()

func (*XMLTestSuite) EndTestCase

func (xml *XMLTestSuite) EndTestCase()

func (*XMLTestSuite) Errorf

func (xml *XMLTestSuite) Errorf(format string, args ...interface{})

func (*XMLTestSuite) FailNow

func (xml *XMLTestSuite) FailNow()

func (*XMLTestSuite) Failed

func (xml *XMLTestSuite) Failed() bool

func (*XMLTestSuite) Helper

func (xml *XMLTestSuite) Helper()

func (*XMLTestSuite) NewReporterForFile

func (xml *XMLTestSuite) NewReporterForFile(name string) Reporter

func (*XMLTestSuite) Report

func (xml *XMLTestSuite) Report() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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