Add support for running integration tests with dockerized test databases.

This commit is contained in:
go-jet 2021-12-17 16:59:43 +01:00
parent 4d5abc85c6
commit 972fc1d9bf
13 changed files with 210 additions and 67 deletions

View file

@ -71,8 +71,13 @@ func initMySQLDB() {
}
for _, dbName := range mySQLDBs {
cmdLine := fmt.Sprintf("mysql -h 127.0.0.1 -u %s -p%s %s < %s",
dbconfig.MySQLUser, dbconfig.MySQLPassword, dbName, "./testdata/init/mysql/"+dbName+".sql")
cmdLine := fmt.Sprintf("mysql -h %s -P%d -u %s -p%s %s < %s",
dbconfig.MySqLHost,
dbconfig.MySQLPort,
dbconfig.MySQLUser,
dbconfig.MySQLPassword,
dbName,
"./testdata/init/mysql/"+dbName+".sql")
fmt.Println(cmdLine)