Skip to content

Commit

Permalink
require deep equal
Browse files Browse the repository at this point in the history
  • Loading branch information
Hermsi1337 committed Feb 12, 2025
1 parent 1f01cc3 commit a516f67
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/pkg/source/mysqltest/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"database/sql"
"fmt"
"os"
"reflect"
"testing"
"time"

Expand Down Expand Up @@ -149,14 +150,12 @@ func (mySQLDumpAndRestoreTestSuite *MySQLDumpAndRestoreTestSuite) TestMySQLDumpA
}()

// backup test data with brudi and retain test data for verification
var testData []TestStruct
testData, err = mySQLDoBackup(ctx, true, resticContainer, backupPath)
mySQLDumpAndRestoreTestSuite.Require().NoError(err)
testData, backupErr := mySQLDoBackup(ctx, true, resticContainer, backupPath)
mySQLDumpAndRestoreTestSuite.Require().NoError(backupErr)

// restore database from backup and pull test data from it for verification
var restoreResult []TestStruct
restoreResult, err = mySQLDoRestore(ctx, true, resticContainer, backupPath)
mySQLDumpAndRestoreTestSuite.Require().NoError(err)
restoreResult, restoreErr := mySQLDoRestore(ctx, true, resticContainer, backupPath)
mySQLDumpAndRestoreTestSuite.Require().NoError(restoreErr)

assert.DeepEqual(mySQLDumpAndRestoreTestSuite.T(), testData, restoreResult)
}
Expand Down Expand Up @@ -192,7 +191,7 @@ func (mySQLDumpAndRestoreTestSuite *MySQLDumpAndRestoreTestSuite) TestMySQLDumpA
restoreResult, err = mySQLDoRestore(ctx, true, resticContainer, backupPathZip)
mySQLDumpAndRestoreTestSuite.Require().NoError(err)

assert.DeepEqual(mySQLDumpAndRestoreTestSuite.T(), testData, restoreResult)
mySQLDumpAndRestoreTestSuite.Require().True(reflect.DeepEqual(testData, restoreResult))
}

func TestMySQLDumpAndRestoreTestSuite(t *testing.T) {
Expand Down Expand Up @@ -399,7 +398,7 @@ mysqldump:
force: true
allDatabases: true
resultFile: %s
skipSsl: true
ssl: 0
additionalArgs: []
mysqlrestore:
options:
Expand Down

0 comments on commit a516f67

Please sign in to comment.