Skip to content

Commit b753064

Browse files
committed
fix postgres version
1 parent b559423 commit b753064

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

test/pkg/source/postgrestest/postgres_test.go

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const dumpKind = "pgdump"
3737
// mysql and psql are a bit picky when it comes to localhost, use ip instead
3838
const hostName = "127.0.0.1"
3939
const dbDriver = "pgx"
40-
const pgImage = "docker.io/bitnami/postgresql:latest"
40+
const pgImage = "docker.io/bitnami/postgresql:17"
4141
const plainKind = "plain"
4242

4343
type PGDumpAndRestoreTestSuite struct {
@@ -328,7 +328,14 @@ func pgDoBackup(
328328
}
329329

330330
// create a brudi config for pgdump
331-
testPGConfig := createPGConfig(pgBackupTarget, useRestic, resticContainer.Address, resticContainer.Port, format, path)
331+
testPGConfig := createPGConfig(
332+
pgBackupTarget,
333+
useRestic,
334+
resticContainer.Address,
335+
resticContainer.Port,
336+
format,
337+
path,
338+
)
332339
err = viper.ReadConfig(bytes.NewBuffer(testPGConfig))
333340
if err != nil {
334341
return []testStruct{}, err
@@ -362,7 +369,14 @@ func pgDoRestore(
362369
}()
363370

364371
// create a brudi configuration for pgrestore, depending on backup format
365-
restorePGConfig := createPGConfig(pgRestoreTarget, useRestic, resticContainer.Address, resticContainer.Port, format, path)
372+
restorePGConfig := createPGConfig(
373+
pgRestoreTarget,
374+
useRestic,
375+
resticContainer.Address,
376+
resticContainer.Port,
377+
format,
378+
path,
379+
)
366380
err = viper.ReadConfig(bytes.NewBuffer(restorePGConfig))
367381
if err != nil {
368382
return []testStruct{}, err
@@ -427,7 +441,11 @@ func pgDoRestore(
427441
}
428442

429443
// createPGConfig creates a brudi config for the pgdump and the correct restoration command based on format
430-
func createPGConfig(container commons.TestContainerSetup, useRestic bool, resticIP, resticPort, format, path string) []byte {
444+
func createPGConfig(
445+
container commons.TestContainerSetup,
446+
useRestic bool,
447+
resticIP, resticPort, format, path string,
448+
) []byte {
431449
var restoreConfig string
432450
if format != plainKind {
433451
restoreConfig = fmt.Sprintf(
@@ -513,7 +531,14 @@ func prepareTestData(database *sql.DB) ([]testStruct, error) {
513531
testData := []testStruct{testStruct1}
514532
var insert *sql.Rows
515533
for idx := range testData {
516-
insert, err = database.Query(fmt.Sprintf("INSERT INTO %s (id, name) VALUES ( %d, '%s' )", tableName, testData[idx].ID, testData[idx].Name))
534+
insert, err = database.Query(
535+
fmt.Sprintf(
536+
"INSERT INTO %s (id, name) VALUES ( %d, '%s' )",
537+
tableName,
538+
testData[idx].ID,
539+
testData[idx].Name,
540+
),
541+
)
517542
if err != nil {
518543
return []testStruct{}, err
519544
}

0 commit comments

Comments
 (0)