Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion nix/ext/tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,25 @@ let
with subtest("Check pg_regress with postgresql 15 after installing the last version"):
test.check_pg_regress(Path("${psql_15}/lib/pgxs/src/test/regress/pg_regress"), "15", pg_regress_test_name)

has_update_script = False
with subtest("switch to postgresql 17"):
server.succeed(
f"{pg17_configuration}/bin/switch-to-configuration test >&2"
)
has_update_script = server.succeed(
"test -f /var/lib/postgresql/update_extensions.sql && echo 'yes' || echo 'no'"
).strip() == "yes"
if has_update_script:
# Run the extension update script generated during the upgrade
test.run_sql_file("/var/lib/postgresql/update_extensions.sql")

with subtest("Check last version of the extension after postgresql upgrade"):
test.assert_version_matches(last_version)
if has_update_script:
# If there was an update script, the last version should be installed
test.assert_version_matches(versions["17"][-1])
else:
# Otherwise, the version should match the last version from postgresql 15
test.assert_version_matches(last_version)

with subtest("Check upgrade path with postgresql 17"):
test.check_upgrade_path("17")
Expand Down Expand Up @@ -223,6 +235,7 @@ builtins.listToAttrs (
"pg_net"
"pgaudit"
"pg_tle"
"postgis"
"vector"
"wrappers"
]
Expand Down
3 changes: 3 additions & 0 deletions nix/ext/tests/http.nix
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,6 @@ self.inputs.nixpkgs.lib.nixos.runTest {
check_upgrade_path("17")
'';
}
# We don't use the generic test for this extension because:
# http is not using semver versioning scheme, so we need to adapt the version checks
# otherwise the test fails with ERROR: extension "http" has no installation script nor update path for version "1.5.0"
3 changes: 3 additions & 0 deletions nix/ext/tests/pg_repack.nix
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,6 @@ self.inputs.nixpkgs.lib.nixos.runTest {
test.check_upgrade_path("17")
'';
}
# We don't use the generic test for this extension because:
# pg_repack does not support upgrade as the extension doesn't provide the upgrade SQL scripts
# and fails with ERROR: extension "pg_repack" has no update path from version "1.4.8" to version "1.5.0"
1 change: 1 addition & 0 deletions nix/ext/tests/pgrouting.nix
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,4 @@ self.inputs.nixpkgs.lib.nixos.runTest {
check_upgrade_path("orioledb-17")
'';
}
# We don't use the generic test for this extension because: it requires postgis to be installed as well.
156 changes: 0 additions & 156 deletions nix/ext/tests/postgis.nix

This file was deleted.