From 793acd276a04ff3058a6fa805189ca4001922483 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Thu, 27 Oct 2022 15:47:15 +0200 Subject: [PATCH] test: Non-existing config options should not break anything Signed-off-by: Wolfgang Walther --- test/io/config.py | 1 + test/io/configs/defaults.config | 2 ++ test/io/db_config.sql | 2 ++ 3 files changed, 5 insertions(+) diff --git a/test/io/config.py b/test/io/config.py index 6cb63af14..723aaf189 100644 --- a/test/io/config.py +++ b/test/io/config.py @@ -41,6 +41,7 @@ def defaultenv(baseenv): "PGRST_DB_CONFIG": "true", "PGRST_LOG_LEVEL": "info", "PGRST_DB_POOL": "1", + "PGRST_NOT_EXISTING": "should not break any tests", } diff --git a/test/io/configs/defaults.config b/test/io/configs/defaults.config index f2cbab203..2d286b45f 100644 --- a/test/io/configs/defaults.config +++ b/test/io/configs/defaults.config @@ -1,2 +1,4 @@ # Not the default, but only works with PG* variables, which are not set db-config = false +# not existing config options should not break tests +not-existing = "should succeed" diff --git a/test/io/db_config.sql b/test/io/db_config.sql index 703040b08..0280c53c6 100644 --- a/test/io/db_config.sql +++ b/test/io/db_config.sql @@ -16,10 +16,12 @@ ALTER ROLE db_config_authenticator SET pgrst.db_prepared_statements = 'false'; ALTER ROLE db_config_authenticator SET pgrst.db_pre_request = 'test.custom_headers'; ALTER ROLE db_config_authenticator SET pgrst.db_max_rows = '1000'; ALTER ROLE db_config_authenticator SET pgrst.db_extra_search_path = 'public, extensions'; +ALTER ROLE db_config_authenticator SET pgrst.not_existing = 'should be ignored'; -- override with database specific setting ALTER ROLE db_config_authenticator IN DATABASE :DBNAME SET pgrst.jwt_secret = 'OVERRIDE=REALLY=REALLY=REALLY=REALLY=VERY=SAFE'; ALTER ROLE db_config_authenticator IN DATABASE :DBNAME SET pgrst.db_extra_search_path = 'public, extensions, private'; +ALTER ROLE db_config_authenticator IN DATABASE :DBNAME SET pgrst.not_existing = 'should be ignored'; -- other database settings that should be ignored CREATE DATABASE other;