Skip to content

Commit 7efb009

Browse files
authored
feat: run pg_regress tests after installing the last version of the extension (#1826)
We have been testing the extension by running pg_regress tests after the migration of the extension (from the first available version to the last one). However, we were not testing the case where the last version of the extension is installed directly. This change adds a test for that case.
1 parent 39f9a0e commit 7efb009

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

nix/ext/tests/default.nix

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ let
151151
with subtest("Check upgrade path with postgresql 15"):
152152
test.check_upgrade_path("15")
153153
154-
with subtest("Check pg_regress with postgresql 15"):
154+
with subtest("Check pg_regress with postgresql 15 after extension upgrade"):
155155
test.check_pg_regress(Path("${psql_15}/lib/pgxs/src/test/regress/pg_regress"), "15", pg_regress_test_name)
156156
157157
last_version = None
@@ -162,18 +162,27 @@ let
162162
with subtest("Test switch_${pname}_version"):
163163
test.check_switch_extension_with_background_worker(Path("${psql_15}/lib/${pname}.so"), "15")
164164
165+
with subtest("Check pg_regress with postgresql 15 after installing the last version"):
166+
test.check_pg_regress(Path("${psql_15}/lib/pgxs/src/test/regress/pg_regress"), "15", pg_regress_test_name)
167+
165168
with subtest("switch to postgresql 17"):
166169
server.succeed(
167170
f"{pg17_configuration}/bin/switch-to-configuration test >&2"
168171
)
169172
170-
with subtest("Check last version of the extension after upgrade"):
173+
with subtest("Check last version of the extension after postgresql upgrade"):
171174
test.assert_version_matches(last_version)
172175
173176
with subtest("Check upgrade path with postgresql 17"):
174177
test.check_upgrade_path("17")
175178
176-
with subtest("Check pg_regress with postgresql 17"):
179+
with subtest("Check pg_regress with postgresql 17 after extension upgrade"):
180+
test.check_pg_regress(Path("${psql_17}/lib/pgxs/src/test/regress/pg_regress"), "17", pg_regress_test_name)
181+
182+
with subtest("Check the install of the last version of the extension"):
183+
test.check_install_last_version("17")
184+
185+
with subtest("Check pg_regress with postgresql 17 after installing the last version"):
177186
test.check_pg_regress(Path("${psql_17}/lib/pgxs/src/test/regress/pg_regress"), "17", pg_regress_test_name)
178187
'';
179188
};

0 commit comments

Comments
 (0)