chore(tests): bump the postgres version used in CI (#6763)

* bump the postgress version used in CI and fix the tests that broke

* sort Grants by raw grant string rather than GrantStrings

* trigger ci
This commit is contained in:
Emilia authored and GitHub committed 2026-08-06 12:09:06 -04:00
1 parent 886cd2918d
commit 01cd5c86e8
6 files changed
+28 -8

No files matched your search

@@ -2120,8 +2120,12 @@ func checkEqualGrants(t *testing.T, expected []string, got *pb.Role) {
require.Equal(len(expected), len(got.GrantStrings))
require.Equal(len(expected), len(got.Grants))
// sort expected and got to ensure they are in the same order
// expected, got.Grants and got.GrantStrings need to be in the same order
sort.Strings(expected)
sort.Slice(got.Grants, func(i, j int) bool {
return got.Grants[i].GetRaw() < got.Grants[j].GetRaw()
})
sort.Slice(got.GrantStrings, func(i, j int) bool {
return got.GrantStrings[i] < got.GrantStrings[j]
})
@@ -2134,6 +2138,8 @@ func checkEqualGrants(t *testing.T, expected []string, got *pb.Role) {
j := got.Grants[i].GetJson()
require.NotNil(j)
assert.Equal(parsed.Id(), j.GetId())
sort.Strings(parsed.Ids())
sort.Strings(j.Ids)
assert.Equal(parsed.Ids(), j.GetIds())
assert.Equal(parsed.Type().String(), j.GetType())
_, acts := parsed.Actions()
@@ -372,7 +372,7 @@ func validateRepairFunc(t *testing.T, rw *db.Db, repairReport migration.Repairs)
})
}
require.NoError(rows.Err())
require.Equal([]targetAssociation{
require.ElementsMatch([]targetAssociation{
{
targetId: "ttcp_PRJA___65001",
resourceId: "clvlt_PRJA___65001",
@@ -286,7 +286,7 @@ func Test_IamRoleAndGrantScopeMigration(t *testing.T) {
require.NoError(rows.Err())
require.NoError(rows.Close())
require.Len(globalRoles, 10)
require.Equal([]testRole{
require.ElementsMatch([]testRole{
{
role_id: "r_go____name",
scope_id: "global",
@@ -400,7 +400,7 @@ func Test_IamRoleAndGrantScopeMigration(t *testing.T) {
require.NoError(rows.Err())
require.NoError(rows.Close())
require.Len(orgRoles, 6)
require.Equal([]testRole{
require.ElementsMatch([]testRole{
{
role_id: "r_op_bc__art",
scope_id: "o_____colors",
@@ -477,7 +477,7 @@ func Test_IamRoleAndGrantScopeMigration(t *testing.T) {
require.NoError(rows.Err())
require.NoError(rows.Close())
require.Len(projRoles, 5)
require.Equal([]testRole{
require.ElementsMatch([]testRole{
{
role_id: "r_prjaa____test",
scope_id: "p_pA____test",
@@ -562,7 +562,7 @@ func Test_IamRoleAndGrantScopeMigration(t *testing.T) {
require.NoError(rows.Err())
require.NoError(rows.Close())
require.Len(individualProjRoles, 2)
require.Equal([]testRole{
require.ElementsMatch([]testRole{
{
role_id: "r_gp____spec",
scope_id: "p____bcolors",
@@ -592,7 +592,7 @@ func Test_IamRoleAndGrantScopeMigration(t *testing.T) {
require.NoError(rows.Err())
require.NoError(rows.Close())
require.Len(individualOrgRoles, 2)
require.Equal([]testRole{
require.ElementsMatch([]testRole{
{
role_id: "r_op_rc__art",
scope_id: "p____rcolors",
@@ -0,0 +1,7 @@
FROM postgres:17-alpine
ADD init-db.sh /docker-entrypoint-initdb.d/00-init-db.sh
ADD restore-benchmark-dumps.sh /docker-entrypoint-initdb.d/01-restore-benchmark-dumps.sh
ADD postgresql.conf /etc/postgresql/postgresql.conf
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
@@ -0,0 +1,7 @@
FROM postgres:18-alpine
ADD init-db.sh /docker-entrypoint-initdb.d/00-init-db.sh
ADD restore-benchmark-dumps.sh /docker-entrypoint-initdb.d/01-restore-benchmark-dumps.sh
ADD postgresql.conf /etc/postgresql/postgresql.conf
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]
+1 -1
View File
@@ -6,7 +6,7 @@ DOCKER_ARGS ?= -d
DOCKER_MIRROR?=docker.io
REGISTRY_NAME?=hashicorpboundary
TEST_IMAGE_NAME=postgres
TEST_IMAGE_TAG ?= $(DOCKER_MIRROR)/$(REGISTRY_NAME)/$(TEST_IMAGE_NAME):12-alpine
TEST_IMAGE_TAG ?= $(DOCKER_MIRROR)/$(REGISTRY_NAME)/$(TEST_IMAGE_NAME):16-alpine
PG_OPTS ?=
TEST_DB_PORT ?= 5432
TEST_CONTAINER_NAME ?= boundary-sql-tests