[bitnami/supabase-postgres] Add VIB tests (#34143)

Signed-off-by: Andrés Bono <andresbono@vmware.com>
This commit is contained in:
Andrés Bono
2023-05-18 16:53:44 +02:00
committed by GitHub
parent 27720dd821
commit 1dd41c90f0
5 changed files with 92 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
gossfile:
# Goss tests exclusive to the current container
../../supabase-postgres/goss/supabase-postgres.yaml: {}
# Load scripts from .vib/common/goss/templates
../../common/goss/templates/check-binaries.yaml: {}
../../common/goss/templates/check-broken-symlinks.yaml: {}
../../common/goss/templates/check-ca-certs.yaml: {}
../../common/goss/templates/check-directories.yaml: {}
../../common/goss/templates/check-files.yaml: {}
../../common/goss/templates/check-linked-libraries.yaml: {}
../../common/goss/templates/check-sed-in-place.yaml: {}
../../common/goss/templates/check-spdx.yaml: {}

View File

@@ -0,0 +1,15 @@
command:
# PostgreSQL should match the major version
check-postgresql-version:
exec: {{ .Vars.version.bin_name }} {{ .Vars.version.flag }} | grep "$(echo $APP_VERSION | sed -E 's|^([0-9]+\.).+$| \1|g')"
exit-status: 0
file:
/opt/bitnami/postgresql/logs/postgresql.log:
exists: true
filetype: symlink
linked-to: /dev/stdout
/opt/bitnami/postgresql/conf/postgresql.conf:
exists: true
mode: "0664"
contains:
- /^include_dir = 'conf.d'/

View File

@@ -0,0 +1,31 @@
binaries:
- java
- postgres
- psql
- pg_dump
- pg_dumpall
- pg_restore
directories:
- paths:
- /opt/bitnami/supabase-postgres/migrations/db
- mode: "0775"
paths:
- /bitnami/postgresql
- /bitnami/postgresql/conf
- /bitnami/postgresql/conf/conf.d
- /docker-entrypoint-initdb.d
- /opt/bitnami/postgresql/conf
- /opt/bitnami/postgresql/conf/conf.d
- /opt/bitnami/postgresql/logs
- /opt/bitnami/postgresql/tmp
files:
- paths:
- /opt/bitnami/supabase-postgres/migrations/00-schema.sql
- /opt/bitnami/supabase-postgres/migrations/01-extension.sql
- /opt/bitnami/postgresql/conf/pg_hba.conf
- /opt/bitnami/postgresql/lib/timescaledb.so
- /opt/bitnami/postgresql/share/extension/timescaledb.control
root_dir: /opt/bitnami
version:
bin_name: postgres
flag: --version

View File

@@ -3,7 +3,8 @@
"resources": {
"url": "{VIB_ENV_CONTAINER_URL}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -69,6 +70,21 @@
}
}
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "supabase-postgres/goss/goss.yaml",
"vars_file": "supabase-postgres/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-supabase-postgres"
}
}
}
}
]
},

View File

@@ -3,7 +3,8 @@
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "{VIB_ENV_PATH}"
}
},
"runtime_parameters": "Y29tbWFuZDogWyJ0YWlsIiwgIi1mIiwgIi9kZXYvbnVsbCJd"
},
"phases": {
"package": {
@@ -46,6 +47,21 @@
"OS"
]
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "supabase-postgres/goss/goss.yaml",
"vars_file": "supabase-postgres/goss/vars.yaml",
"remote": {
"pod": {
"workload": "deploy-supabase-postgres"
}
}
}
}
]
}