Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestDir ¶
func FindFreePort ¶
func FindFreePort() int
FindFreePort returns an available port that can be used for a server. If any errors are encountered, this function will panic and fail the current test.
func StartDuckSqlServer ¶
func StartDuckSqlServer(t *testing.T, dir string, persistentSystemVars map[string]string, testEnv *TestEnv) error
StartDuckSqlServer starts a sql-server on a free port from the specified directory |dir|. If |peristentSystemVars| is populated, then those system variables will be set, persistently, for the database, before the sql-server is started.
func StopDuckSqlServer ¶
StopDuckSqlServer stops the running Dolt sql-server. If any errors are encountered while stopping the Dolt sql-server, this function will fail the current test.
func WaitForSqlServerToStart ¶
WaitForSqlServerToStart polls the specified database to wait for it to become available, pausing between retry attempts, and returning an error if it is not able to verify that the database is available.
Types ¶
type TestEnv ¶
type TestEnv struct {
MySqlContainer string
MySqlPort, DuckPort, DuckPgPort int
DuckProcess *os.Process
DuckLogFilePath, OldDuckLogFilePath string
DuckLogFile, MysqlLogFile *os.File
TestDir string
OriginalWorkingDir string
MyDuckServer *sqlx.DB
}
Create a struct that stores all these values:
func NewTestEnv ¶
func NewTestEnv() *TestEnv