mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-24 23:08:55 +01:00
Fix unknown mysql config file path
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
parent
626b36f6c5
commit
0422b36acf
@ -5,7 +5,10 @@ package testutil
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
@ -20,9 +23,14 @@ var mysqlContainerConfigPath = "../testdata/mysql.cnf"
|
||||
func CreateMysqlTestContainer() (func(), error) {
|
||||
ctx := context.Background()
|
||||
|
||||
_, caller, _, ok := runtime.Caller(0)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("failed to get caller information")
|
||||
}
|
||||
|
||||
container, err := mysql.Run(ctx,
|
||||
"mysql:8.0.40",
|
||||
mysql.WithConfigFile(mysqlContainerConfigPath),
|
||||
mysql.WithConfigFile(filepath.Join(filepath.Dir(caller), mysqlContainerConfigPath)),
|
||||
mysql.WithDatabase("netbird"),
|
||||
mysql.WithUsername("root"),
|
||||
mysql.WithPassword("netbird"),
|
||||
|
Loading…
Reference in New Issue
Block a user