Skip to content

Commit d025f95

Browse files
committed
Fix two CI-only failures in the get_ctypes regression tests.
The ICU scenario ran unconditionally, but LOCALE_PROVIDER/ICU_LOCALE on CREATE DATABASE was only added in PostgreSQL 15, so it failed with "option \"locale_provider\" not recognized" against PG14 in CI. The builtin scenario probes with a fixed BUILTIN_LOCALE 'C.UTF-8', and skipped only when template0's own datcollate was exactly 'C' or 'POSIX'. Several CI runners have template0 already on 'C.UTF-8', which is the only UTF-8 locale a builtin database can use, so the created database's locale collided with the template's inherited one and assertNotIn(self.template_collate, reported) failed spuriously. Skip that scenario too when template0 is already 'C.UTF-8'.
1 parent 0b3a7f1 commit d025f95

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎web/pgadmin/browser/server_groups/servers/databases/tests/test_db_get_ctypes.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ def runTest(self):
116116
self.skipTest("template0 is %s encoded, so a UTF-8 builtin "
117117
"locale cannot be used here."
118118
% self.template_encoding)
119+
if self.template_collate == 'C.UTF-8':
120+
self.skipTest("template0 already uses the 'C.UTF-8' locale, "
121+
"the only one a UTF-8 builtin database can "
122+
"use, so a distinguishable one cannot be "
123+
"created here.")
119124
self._skip_unless_distinct_template_locale()
120125
self._create_database("LOCALE_PROVIDER builtin "
121126
"BUILTIN_LOCALE 'C.UTF-8' ENCODING UTF8")
@@ -128,6 +133,9 @@ def runTest(self):
128133
return
129134

130135
# ICU
136+
if self.server_version < 150000:
137+
self.skipTest('LOCALE_PROVIDER icu requires PostgreSQL 15 or '
138+
'later.')
131139
cursor = self.connection.cursor()
132140
cursor.execute("SELECT 1 FROM pg_catalog.pg_collation "
133141
"WHERE collprovider = 'i' LIMIT 1")

0 commit comments

Comments
 (0)