Documentation
¶
Index ¶
- Constants
- Variables
- func AddTenantID(db *sql.DB, dbName, tableName string, numberOfTenants int)
- func AssertQueriesHaveEqualResult(t *testing.T, ferry *ghostferry.Ferry, query string, args ...interface{}) []map[string]interface{}
- func AssertTwoQueriesHaveEqualResult(t *testing.T, ferry *ghostferry.Ferry, sourceQuery string, targetQuery string, ...) []map[string]interface{}
- func DbApplicabilityFilter(applicableDbs []string) func([]string) []string
- func FixturePath(name string) string
- func LoadResults(rows *sql.Rows) (out []map[string]interface{}, err error)
- func NewTestConfig() *ghostferry.Config
- func PanicIfError(err error)
- func ProcessListContainsQueries(db *sql.DB, queries []string) bool
- func RandByteData() []byte
- func RandData() string
- func RandLatin1Data() string
- func RandUTF8MB4Data() string
- func SeedInitialData(db *sql.DB, dbname, tablename string, numberOfRows int)
- func SetupTest()
- type DataWriter
- type ErrorHandler
- type GhostferryUnitTestSuite
- type IntegrationTestCase
- func (this *IntegrationTestCase) AssertOnlyDataOnSourceAndTargetIs(data string)
- func (this *IntegrationTestCase) AssertQueriesHaveEqualResult(query string, args ...interface{}) []map[string]interface{}
- func (this *IntegrationTestCase) CopyData()
- func (this *IntegrationTestCase) Run()
- func (this *IntegrationTestCase) SetReadonlyOnSourceDbAndStopDataWriter()
- func (this *IntegrationTestCase) Setup()
- func (this *IntegrationTestCase) StartFerryAndDataWriter()
- func (this *IntegrationTestCase) StopStreamingAndWaitForGhostferryFinish()
- func (this *IntegrationTestCase) Teardown()
- func (this *IntegrationTestCase) VerifyData()
- func (this *IntegrationTestCase) WaitUntilRowCopyIsComplete()
- type MixedActionDataWriter
- func (this *MixedActionDataWriter) DeleteData() error
- func (this *MixedActionDataWriter) InsertData() error
- func (this *MixedActionDataWriter) Run()
- func (this *MixedActionDataWriter) SetDB(db *sql.DB)
- func (this *MixedActionDataWriter) Stop()
- func (this *MixedActionDataWriter) UpdateData() error
- func (this *MixedActionDataWriter) Wait()
- func (this *MixedActionDataWriter) WriteData(i int)
- type TestFerry
- type TestTableFilter
Constants ¶
View Source
const ( TestSchemaName = "gftest" TestTable1Name = "test_table_1" )
Variables ¶
View Source
var ( TestSourcePort = getPortFromEnv("N1_PORT", 29291) TestTargetPort = getPortFromEnv("N2_PORT", 29292) ApplicableTestDbs = []string{"gftest", "gftest1", "gftest2"} )
Functions ¶
func DbApplicabilityFilter ¶
func FixturePath ¶
func NewTestConfig ¶
func NewTestConfig() *ghostferry.Config
func PanicIfError ¶
func PanicIfError(err error)
func RandLatin1Data ¶
func RandLatin1Data() string
RandLatin1Data returns a UTF-8 string with valid codepoints for a latin1 charset
func RandUTF8MB4Data ¶
func RandUTF8MB4Data() string
RandUTF8MB4Data returns a UTF-8 string with valid codepoints up to U+10FFFF
Types ¶
type DataWriter ¶
type ErrorHandler ¶
type ErrorHandler struct {
LastError error
}
func (*ErrorHandler) Fatal ¶
func (this *ErrorHandler) Fatal(from string, err error)
type GhostferryUnitTestSuite ¶
type GhostferryUnitTestSuite struct { suite.Suite TestFerry *TestFerry Ferry *ghostferry.Ferry }
func (*GhostferryUnitTestSuite) SeedSourceDB ¶
func (this *GhostferryUnitTestSuite) SeedSourceDB(numberOfRows int)
func (*GhostferryUnitTestSuite) SeedTargetDB ¶
func (this *GhostferryUnitTestSuite) SeedTargetDB(numberOfRows int)
func (*GhostferryUnitTestSuite) SetupTest ¶
func (this *GhostferryUnitTestSuite) SetupTest()
func (*GhostferryUnitTestSuite) TearDownTest ¶
func (this *GhostferryUnitTestSuite) TearDownTest()
type IntegrationTestCase ¶
type IntegrationTestCase struct { T *testing.T SetupAction func(*TestFerry) AfterStartBinlogStreaming func(*TestFerry) AfterRowCopyIsComplete func(*TestFerry) BeforeStoppingBinlogStreaming func(*TestFerry) AfterStoppedBinlogStreaming func(*TestFerry) CustomVerifyAction func(*TestFerry) DisableChecksumVerifier bool DataWriter DataWriter Ferry *TestFerry Verifier *ghostferry.ChecksumTableVerifier // contains filtered or unexported fields }
func (*IntegrationTestCase) AssertOnlyDataOnSourceAndTargetIs ¶
func (this *IntegrationTestCase) AssertOnlyDataOnSourceAndTargetIs(data string)
func (*IntegrationTestCase) AssertQueriesHaveEqualResult ¶
func (this *IntegrationTestCase) AssertQueriesHaveEqualResult(query string, args ...interface{}) []map[string]interface{}
func (*IntegrationTestCase) CopyData ¶
func (this *IntegrationTestCase) CopyData()
func (*IntegrationTestCase) Run ¶
func (this *IntegrationTestCase) Run()
func (*IntegrationTestCase) SetReadonlyOnSourceDbAndStopDataWriter ¶
func (this *IntegrationTestCase) SetReadonlyOnSourceDbAndStopDataWriter()
func (*IntegrationTestCase) Setup ¶
func (this *IntegrationTestCase) Setup()
func (*IntegrationTestCase) StartFerryAndDataWriter ¶
func (this *IntegrationTestCase) StartFerryAndDataWriter()
func (*IntegrationTestCase) StopStreamingAndWaitForGhostferryFinish ¶
func (this *IntegrationTestCase) StopStreamingAndWaitForGhostferryFinish()
func (*IntegrationTestCase) Teardown ¶
func (this *IntegrationTestCase) Teardown()
func (*IntegrationTestCase) VerifyData ¶
func (this *IntegrationTestCase) VerifyData()
func (*IntegrationTestCase) WaitUntilRowCopyIsComplete ¶
func (this *IntegrationTestCase) WaitUntilRowCopyIsComplete()
type MixedActionDataWriter ¶
type MixedActionDataWriter struct { ProbabilityOfInsert float32 ProbabilityOfUpdate float32 ProbabilityOfDelete float32 ModifyIdRange [2]int64 NumberOfWriters int Db *sql.DB Tables []string ExtraInsertData func(string, map[string]interface{}) ExtraUpdateData func(string, map[string]interface{}) // contains filtered or unexported fields }
func (*MixedActionDataWriter) DeleteData ¶
func (this *MixedActionDataWriter) DeleteData() error
func (*MixedActionDataWriter) InsertData ¶
func (this *MixedActionDataWriter) InsertData() error
func (*MixedActionDataWriter) Run ¶
func (this *MixedActionDataWriter) Run()
func (*MixedActionDataWriter) SetDB ¶
func (this *MixedActionDataWriter) SetDB(db *sql.DB)
func (*MixedActionDataWriter) Stop ¶
func (this *MixedActionDataWriter) Stop()
func (*MixedActionDataWriter) UpdateData ¶
func (this *MixedActionDataWriter) UpdateData() error
func (*MixedActionDataWriter) Wait ¶
func (this *MixedActionDataWriter) Wait()
func (*MixedActionDataWriter) WriteData ¶
func (this *MixedActionDataWriter) WriteData(i int)
type TestFerry ¶
type TestFerry struct { *ghostferry.Ferry BeforeBatchCopyListener func(batch *ghostferry.RowBatch) error BeforeBinlogApplyListener func(events []ghostferry.DMLEvent) error BeforeRowCopyDoneListener func() error AfterBatchCopyListener func(batch *ghostferry.RowBatch) error AfterBinlogApplyListener func(events []ghostferry.DMLEvent) error AfterRowCopyDoneListener func() error }
func NewTestFerry ¶
func NewTestFerry() *TestFerry
func (*TestFerry) Initialize ¶
type TestTableFilter ¶
type TestTableFilter struct { DbsFunc func([]string) []string TablesFunc func([]*schema.Table) []*schema.Table }
func (*TestTableFilter) ApplicableDatabases ¶
func (t *TestTableFilter) ApplicableDatabases(dbs []string) ([]string, error)
func (*TestTableFilter) ApplicableTables ¶
Click to show internal directories.
Click to hide internal directories.