Documentation ¶
Index ¶
- func AssertQueryRuns(connection *dbconn.DBConn, query string)
- func CreateAndConnectMockDB(numConns int) (*dbconn.DBConn, sqlmock.Sqlmock)
- func CreateMockDB() (*sqlx.DB, sqlmock.Sqlmock)
- func CreateMockDBConn(errs ...error) (*dbconn.DBConn, sqlmock.Sqlmock)
- func ExpectRegexp(buffer *gbytes.Buffer, testStr string)
- func ExpectVersionQuery(mock sqlmock.Sqlmock, versionStr string)
- func MockFileContents(contents string)
- func NotExpectRegexp(buffer *gbytes.Buffer, testStr string)
- func SetDBVersion(connection *dbconn.DBConn, versionStr string)
- func SetupTestEnvironment() (*dbconn.DBConn, sqlmock.Sqlmock, *gbytes.Buffer, *gbytes.Buffer, ...)
- func SetupTestLogger() (*gbytes.Buffer, *gbytes.Buffer, *gbytes.Buffer)
- func ShouldPanicWithMessage(message string)
- type TestDriver
- type TestExecutor
- type TestResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertQueryRuns ¶
func CreateAndConnectMockDB ¶
func ExpectRegexp ¶
func ExpectVersionQuery ¶
func MockFileContents ¶
func MockFileContents(contents string)
* This function call should be followed by a call to InitializeSystemFunctions * in a defer statement or AfterEach block.
func NotExpectRegexp ¶
func SetDBVersion ¶
* While this function is technically redundant with dbconn.NewVersion, it's * here to allow `defer`ing version changes easily, instead of needing e.g. * "defer func() { connection.Version = dbconn.NewVersion(versionStr) }()" or * something similarly ugly.
func SetupTestEnvironment ¶
func ShouldPanicWithMessage ¶
func ShouldPanicWithMessage(message string)
Types ¶
type TestDriver ¶
type TestExecutor ¶
type TestExecutor struct { LocalOutput string LocalError error LocalCommands []string ClusterOutput *cluster.RemoteOutput ClusterCommands [][]cluster.ShellCommand ErrorOnExecNum int // Throw the specified error after this many executions of Execute[...]Command(); 0 means always return error NumExecutions int }
func (*TestExecutor) ExecuteClusterCommand ¶
func (executor *TestExecutor) ExecuteClusterCommand(scope cluster.Scope, commandList []cluster.ShellCommand) *cluster.RemoteOutput
func (*TestExecutor) ExecuteLocalCommand ¶
func (executor *TestExecutor) ExecuteLocalCommand(commandStr string) (string, error)
type TestResult ¶
type TestResult struct {
Rows int64
}
func (TestResult) LastInsertId ¶
func (result TestResult) LastInsertId() (int64, error)
func (TestResult) RowsAffected ¶
func (result TestResult) RowsAffected() (int64, error)
Click to show internal directories.
Click to hide internal directories.