Skip to content
Merged
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
6 changes: 3 additions & 3 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.5.1.058-orioledb"
postgres17: "17.6.1.037"
postgres15: "15.14.1.037"
postgresorioledb-17: "17.5.1.059-orioledb"
postgres17: "17.6.1.038"
postgres15: "15.14.1.038"

# Non Postgres Extensions
pgbouncer_release: 1.19.0
Expand Down
16 changes: 12 additions & 4 deletions nix/ext/tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,20 @@ let
enable = true;
package = psql_15;
enableTCPIP = true;
initialScript = pkgs.writeText "init-postgres-with-password" ''
CREATE USER test WITH PASSWORD 'secret';
'';
authentication = ''
host test postgres samenet scram-sha-256
local all postgres peer map=postgres
local all all peer map=root
'';
identMap = ''
root root supabase_admin
postgres postgres postgres
'';
ensureUsers = [
{
name = "supabase_admin";
ensureClauses.superuser = true;
}
];
settings = (installedExtension "15").defaultSettings or { };
};

Expand Down
4 changes: 2 additions & 2 deletions nix/ext/tests/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ def __init__(

def run_sql(self, query: str) -> str:
return self.vm.succeed(
f"""sudo -u postgres psql -t -A -F\",\" -c \"{query}\" """
f"""psql -U supabase_admin -d postgres -t -A -F\",\" -c \"{query}\" """
).strip()

def run_sql_file(self, file: str) -> str:
return self.vm.succeed(
f"""sudo -u postgres psql -v ON_ERROR_STOP=1 -f \"{file}\""""
f"""psql -U supabase_admin -d postgres -v ON_ERROR_STOP=1 -f \"{file}\""""
).strip()

def drop_extension(self):
Expand Down
16 changes: 12 additions & 4 deletions nix/ext/tests/pg_repack.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,20 @@ self.inputs.nixpkgs.lib.nixos.runTest {
enable = true;
package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15;
enableTCPIP = true;
initialScript = pkgs.writeText "init-postgres-with-password" ''
CREATE USER test WITH PASSWORD 'secret';
'';
authentication = ''
host test postgres samenet scram-sha-256
local all postgres peer map=postgres
local all all peer map=root
'';
identMap = ''
root root supabase_admin
postgres postgres postgres
'';
ensureUsers = [
{
name = "supabase_admin";
ensureClauses.superuser = true;
}
];
};

networking.firewall.allowedTCPPorts = [ config.services.postgresql.settings.port ];
Expand Down
14 changes: 14 additions & 0 deletions nix/ext/tests/pgmq.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ self.inputs.nixpkgs.lib.nixos.runTest {
services.postgresql = {
enable = true;
package = (postgresqlWithExtension psql_15);
authentication = ''
local all postgres peer map=postgres
local all all peer map=root
'';
identMap = ''
root root supabase_admin
postgres postgres postgres
'';
ensureUsers = [
{
name = "supabase_admin";
ensureClauses.superuser = true;
}
];
settings = (installedExtension "15").defaultSettings or { };
};

Expand Down
18 changes: 16 additions & 2 deletions nix/ext/tests/pgroonga.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@ self.inputs.nixpkgs.lib.nixos.runTest {
services.postgresql = {
enable = true;
package = psql_15;
enableTCPIP = true;
authentication = ''
local all postgres peer map=postgres
local all all peer map=root
'';
identMap = ''
root root supabase_admin
postgres postgres postgres
'';
ensureUsers = [
{
name = "supabase_admin";
ensureClauses.superuser = true;
}
];
};
systemd.services.postgresql.environment.MECAB_DICDIR = "${
self.packages.${pkgs.system}.mecab-naist-jdic
Expand Down Expand Up @@ -120,7 +135,6 @@ self.inputs.nixpkgs.lib.nixos.runTest {
"17": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') (versions "17"))}],
}
extension_name = "${pname}"
support_upgrade = False
pg17_configuration = "${pg17-configuration}"
ext_has_background_worker = ${
if (installedExtension "15") ? hasBackgroundWorker then "True" else "False"
Expand All @@ -135,7 +149,7 @@ self.inputs.nixpkgs.lib.nixos.runTest {
server.wait_for_unit("multi-user.target")
server.wait_for_unit("postgresql.service")

test = PostgresExtensionTest(server, extension_name, versions, sql_test_directory, support_upgrade)
test = PostgresExtensionTest(server, extension_name, versions, sql_test_directory)

with subtest("Check upgrade path with postgresql 15"):
test.check_upgrade_path("15")
Expand Down
16 changes: 12 additions & 4 deletions nix/ext/tests/plpgsql_check.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,20 @@ self.inputs.nixpkgs.lib.nixos.runTest {
enable = true;
package = psql_15;
enableTCPIP = true;
initialScript = pkgs.writeText "init-postgres-with-password" ''
CREATE USER test WITH PASSWORD 'secret';
'';
authentication = ''
host test postgres samenet scram-sha-256
local all postgres peer map=postgres
local all all peer map=root
'';
identMap = ''
root root supabase_admin
postgres postgres postgres
'';
ensureUsers = [
{
name = "supabase_admin";
ensureClauses.superuser = true;
}
];
settings = (installedExtension "15").defaultSettings or { };
};

Expand Down
14 changes: 14 additions & 0 deletions nix/ext/tests/plv8.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ self.inputs.nixpkgs.lib.nixos.runTest {
services.postgresql = {
enable = true;
package = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15;
authentication = ''
local all postgres peer map=postgres
local all all peer map=root
'';
identMap = ''
root root supabase_admin
postgres postgres postgres
'';
ensureUsers = [
{
name = "supabase_admin";
ensureClauses.superuser = true;
}
];
};
};
testScript =
Expand Down
16 changes: 16 additions & 0 deletions nix/ext/tests/timescaledb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,22 @@ self.inputs.nixpkgs.lib.nixos.runTest {
services.postgresql = {
enable = true;
package = (postgresqlWithExtension psql_15);
authentication = ''
local all postgres peer map=postgres
local all all peer map=root
'';
identMap = ''
root root supabase_admin
postgres postgres postgres
'';
ensureUsers = [
{
name = "supabase_admin";
ensureClauses.superuser = true;
}
{ name = "service_role"; }
];

settings = {
shared_preload_libraries = "timescaledb";
};
Expand Down
Loading