Skip to content

Commit

Permalink
test: pin docker image on postgres to 13.4-buster (#12636) (#12644)
Browse files Browse the repository at this point in the history
* test: pin docker image on postgres to 13.4-buster

* test: update all tests that uses postgres image to use 13.4-buster

Co-authored-by: Calvin Leung Huang <1883212+calvn@users.noreply.github.com>
  • Loading branch information
tomhjp and calvn committed Sep 27, 2021
1 parent 5a673af commit fedb9d0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions builtin/logical/database/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func TestBackend_BadConnectionString(t *testing.T) {
}
defer b.Cleanup(context.Background())

cleanup, _ := postgreshelper.PrepareTestContainer(t, "latest")
cleanup, _ := postgreshelper.PrepareTestContainer(t, "13.4-buster")
defer cleanup()

respCheck := func(req *logical.Request) {
Expand Down Expand Up @@ -396,7 +396,7 @@ func TestBackend_basic(t *testing.T) {
}
defer b.Cleanup(context.Background())

cleanup, connURL := postgreshelper.PrepareTestContainer(t, "latest")
cleanup, connURL := postgreshelper.PrepareTestContainer(t, "13.4-buster")
defer cleanup()

// Configure a connection
Expand Down Expand Up @@ -603,7 +603,7 @@ func TestBackend_connectionCrud(t *testing.T) {
}
defer b.Cleanup(context.Background())

cleanup, connURL := postgreshelper.PrepareTestContainer(t, "latest")
cleanup, connURL := postgreshelper.PrepareTestContainer(t, "13.4-buster")
defer cleanup()

// Configure a connection
Expand Down Expand Up @@ -791,7 +791,7 @@ func TestBackend_roleCrud(t *testing.T) {
}
defer b.Cleanup(context.Background())

cleanup, connURL := postgreshelper.PrepareTestContainer(t, "latest")
cleanup, connURL := postgreshelper.PrepareTestContainer(t, "13.4-buster")
defer cleanup()

// Configure a connection
Expand Down Expand Up @@ -1039,7 +1039,7 @@ func TestBackend_allowedRoles(t *testing.T) {
}
defer b.Cleanup(context.Background())

cleanup, connURL := postgreshelper.PrepareTestContainer(t, "latest")
cleanup, connURL := postgreshelper.PrepareTestContainer(t, "13.4-buster")
defer cleanup()

// Configure a connection
Expand Down Expand Up @@ -1236,7 +1236,7 @@ func TestBackend_RotateRootCredentials(t *testing.T) {
}
defer b.Cleanup(context.Background())

cleanup, connURL := postgreshelper.PrepareTestContainer(t, "latest")
cleanup, connURL := postgreshelper.PrepareTestContainer(t, "13.4-buster")
defer cleanup()

connURL = strings.Replace(connURL, "postgres:secret", "{{username}}:{{password}}", -1)
Expand Down
2 changes: 1 addition & 1 deletion builtin/logical/database/rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ func assertWALCount(t *testing.T, s logical.Storage, expected int, key string) {
type userCreator func(t *testing.T, username, password string)

func TestBackend_StaticRole_Rotations_PostgreSQL(t *testing.T) {
cleanup, connURL := postgreshelper.PrepareTestContainer(t, "latest")
cleanup, connURL := postgreshelper.PrepareTestContainer(t, "13.4-buster")
defer cleanup()
uc := userCreator(func(t *testing.T, username, password string) {
createTestPGUser(t, connURL, username, password, testRoleStaticCreate)
Expand Down
2 changes: 1 addition & 1 deletion plugins/database/postgresql/postgresql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func getPostgreSQL(t *testing.T, options map[string]interface{}) (*PostgreSQL, func()) {
cleanup, connURL := postgresql.PrepareTestContainer(t, "latest")
cleanup, connURL := postgresql.PrepareTestContainer(t, "13.4-buster")

connectionDetails := map[string]interface{}{
"connection_url": connURL,
Expand Down

0 comments on commit fedb9d0

Please sign in to comment.