Skip to content

Commit

Permalink
more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hermsi1337 committed Feb 14, 2025
1 parent 1182186 commit 2549c6d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/pkg/source/mysqltest/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"testing"
"time"

"github.com/pkg/errors"

"github.com/mittwald/brudi/pkg/source"
commons "github.com/mittwald/brudi/test/pkg/source/internal"

Expand Down Expand Up @@ -220,10 +222,9 @@ func mySQLDoBackup(
"%s:%s@tcp(%s:%s)/%s?tls=false",
mySQLRoot, mySQLRootPW, mySQLBackupTarget.Address, mySQLBackupTarget.Port, mySQLDatabase,
)
var db *sql.DB
db, err = sql.Open(dbDriver, backupConnectionString)
if err != nil {
return []TestStruct{}, err
db, openDbErr := sql.Open(dbDriver, backupConnectionString)
if openDbErr != nil {
return []TestStruct{}, errors.Wrap(err, "failed to connect mysql backup container")
}
defer func() {
dbErr := db.Close()
Expand All @@ -235,14 +236,14 @@ func mySQLDoBackup(
time.Sleep(5 * time.Second)

// create table for test data
_, err = db.Exec(
_, createTableErr := db.Exec(
fmt.Sprintf(
"CREATE TABLE %s(id INT NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, PRIMARY KEY ( id ));",
tableName,
),
)
if err != nil {
return []TestStruct{}, err
if createTableErr != nil {
return []TestStruct{}, errors.Wrap(createTableErr, "failed to create mysql backup table")
}

// insert test data
Expand Down

0 comments on commit 2549c6d

Please sign in to comment.