From 1dd41c90f0adde8ac3cb6d8308fb678ea552782d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Bono?= Date: Thu, 18 May 2023 16:53:44 +0200 Subject: [PATCH] [bitnami/supabase-postgres] Add VIB tests (#34143) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrés Bono --- .vib/supabase-postgres/goss/goss.yaml | 12 +++++++ .../goss/supabase-postgres.yaml | 15 +++++++++ .vib/supabase-postgres/goss/vars.yaml | 31 +++++++++++++++++++ .vib/supabase-postgres/vib-publish.json | 18 ++++++++++- .vib/supabase-postgres/vib-verify.json | 18 ++++++++++- 5 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 .vib/supabase-postgres/goss/goss.yaml create mode 100644 .vib/supabase-postgres/goss/supabase-postgres.yaml create mode 100644 .vib/supabase-postgres/goss/vars.yaml diff --git a/.vib/supabase-postgres/goss/goss.yaml b/.vib/supabase-postgres/goss/goss.yaml new file mode 100644 index 000000000000..0b0fd622644c --- /dev/null +++ b/.vib/supabase-postgres/goss/goss.yaml @@ -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: {} diff --git a/.vib/supabase-postgres/goss/supabase-postgres.yaml b/.vib/supabase-postgres/goss/supabase-postgres.yaml new file mode 100644 index 000000000000..d35af8684798 --- /dev/null +++ b/.vib/supabase-postgres/goss/supabase-postgres.yaml @@ -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'/ diff --git a/.vib/supabase-postgres/goss/vars.yaml b/.vib/supabase-postgres/goss/vars.yaml new file mode 100644 index 000000000000..ce5b12da90e8 --- /dev/null +++ b/.vib/supabase-postgres/goss/vars.yaml @@ -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 diff --git a/.vib/supabase-postgres/vib-publish.json b/.vib/supabase-postgres/vib-publish.json index 1e2aad8ef471..f30a9128fc38 100644 --- a/.vib/supabase-postgres/vib-publish.json +++ b/.vib/supabase-postgres/vib-publish.json @@ -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" + } + } + } } ] }, diff --git a/.vib/supabase-postgres/vib-verify.json b/.vib/supabase-postgres/vib-verify.json index a34e8aee9161..fbc713e1d4b0 100644 --- a/.vib/supabase-postgres/vib-verify.json +++ b/.vib/supabase-postgres/vib-verify.json @@ -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" + } + } + } } ] }