mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-27 00:09:34 +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 (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
@ -20,9 +23,14 @@ var mysqlContainerConfigPath = "../testdata/mysql.cnf"
|
|||||||
func CreateMysqlTestContainer() (func(), error) {
|
func CreateMysqlTestContainer() (func(), error) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
|
_, caller, _, ok := runtime.Caller(0)
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("failed to get caller information")
|
||||||
|
}
|
||||||
|
|
||||||
container, err := mysql.Run(ctx,
|
container, err := mysql.Run(ctx,
|
||||||
"mysql:8.0.40",
|
"mysql:8.0.40",
|
||||||
mysql.WithConfigFile(mysqlContainerConfigPath),
|
mysql.WithConfigFile(filepath.Join(filepath.Dir(caller), mysqlContainerConfigPath)),
|
||||||
mysql.WithDatabase("netbird"),
|
mysql.WithDatabase("netbird"),
|
||||||
mysql.WithUsername("root"),
|
mysql.WithUsername("root"),
|
||||||
mysql.WithPassword("netbird"),
|
mysql.WithPassword("netbird"),
|
||||||
|
Loading…
Reference in New Issue
Block a user