Documentation ¶
Overview ¶
Package testenv supplies test functions for testing vstreamer.
Index ¶
Constants ¶
const ( DBName = "vttest" DefaultCollationName = "utf8mb4_0900_ai_ci" DefaultShard = "0" )
Variables ¶
var ( // These are exported to coordinate on version specific // behavior between the testenv and its users. CollationEnv *collations.Environment DefaultCollationID collations.ID MySQLVersion string )
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct { KeyspaceName string ShardName string Cells []string TabletEnv tabletenv.Env TopoServ *topo.Server SrvTopo srvtopo.Server Dbcfgs *dbconfigs.DBConfigs Mysqld *mysqlctl.Mysqld SchemaEngine *schema.Engine // MySQL and Percona are considered equivalent here and both called mysql DBType string DBMajorVersion int DBMinorVersion int DBPatchVersion int // contains filtered or unexported fields }
Env contains all the env vars for a test against a mysql instance.
func (*Env) HasCapability ¶ added in v0.17.0
func (te *Env) HasCapability(cap ServerCapability) bool
HasCapability returns true if the server has the given capability. Used to skip tests that require a certain version of MySQL.
func (*Env) RemoveAnyDeprecatedDisplayWidths ¶ added in v0.12.1
In MySQL 8.0 and later information_schema no longer contains the display width for integer types and as of 8.0.19 for year types as this was an unnecessary headache because it can only serve to confuse if the display width is less than the type width (8.0 no longer supports the 2 digit YEAR). So if the test is running against MySQL 8.0 or later then you should use this function to replace e.g. `int([0-9]*)` with `int` in the expected results string that we define in the test.
func (*Env) SetVSchema ¶
SetVSchema sets the vschema for the test keyspace.
type ServerCapability ¶ added in v0.17.0
type ServerCapability int32
ServerCapability is used to define capabilities for which we want to optionally run tests if the underlying mysql server supports them.
const ( ServerCapabilityInvisibleColumn ServerCapability = 1 ServerCapabilityGeneratedInvisiblePrimaryKey ServerCapability = 2 )