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
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}

- name: Build
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert false --run "xpg -v ${{ matrix.pg-version }} build"
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert true --run "xpg -v ${{ matrix.pg-version }} build"

- name: Run tests
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert false --run "xpg -v ${{ matrix.pg-version }} test"
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert true --run "xpg -v ${{ matrix.pg-version }} test"

test-on-macos:
runs-on: macos-26
Expand All @@ -55,10 +55,10 @@ jobs:
rm -rf ./build-${{ matrix.pg-version }}

- name: Build
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert false --run "xpg -v ${{ matrix.pg-version }} build"
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert true --run "xpg -v ${{ matrix.pg-version }} build"

- name: Run tests
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert false --run "xpg -v ${{ matrix.pg-version }} test"
run: nix-shell --argstr pgVersion "${{ matrix.pg-version }}" --arg cassert true --run "xpg -v ${{ matrix.pg-version }} test"

loadtest:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
nixpkgs.url = "github:NixOS/nixpkgs/91c9a64ce2a84e648d0cf9671274bb9c2fb9ba60";

xpg = {
url = "github:supabase/xpg/v2.6.0";
url = "github:supabase/xpg/v2.7.0";
};
};

Expand Down
18 changes: 17 additions & 1 deletion test/test_misc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@

def get_pg_version(conn) -> int:
(pg_version,) = conn.execute(
"""
select current_setting('server_version_num');
"""
).fetchone()
return int(pg_version)


def test_plpgsql_check(conn):
"""
Test check all plpgsql functions (functions or trigger functions with defined
Expand Down Expand Up @@ -33,4 +43,10 @@ def test_plpgsql_check(conn):
) ss
ORDER BY (pcf).functionid::regprocedure::text, (pcf).lineno;
"""
assert len(conn.execute(sql).fetchall()) == 2

# The function random_delay_ms that defined in test/utils/loadtest.sql makes use of
# the postgres function random_normal which only exists in pg16 and beyond. This
# conditional assignment fixes issues resulting from that.
expected_warnings = (3 if get_pg_version(conn) < 160000 else 2)

assert len(conn.execute(sql).fetchall()) == expected_warnings
Loading