Skip to content

Commit

Permalink
pg_partman 5 and pg17 tests for extension ci (#308)
Browse files Browse the repository at this point in the history
* pg_partman 5 tests for extension ci

* install partman with git

* fix workflow fmt

* exclude pg partman tests on pg12, 13

* add test for pg17

* put partman and pg ver in test name
  • Loading branch information
ChuckHend authored Sep 13, 2024
1 parent 13aaabb commit 6fada6b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/extension_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,27 @@ on:

jobs:
test:
name: Run tests
name: Test 🐘 ${{ matrix.pg }} with pg_partman ${{ matrix.partman }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
pg: [12, 13, 14, 15, 16]
pg: [12, 13, 14, 15, 16, 17]
partman: [4.7.3, 5.1.0]
exclude:
# pg_partman does not support pg < 14
- pg: 12
partman: 5.1.0
- pg: 13
partman: 5.1.0
container: pgxn/pgxn-tools
steps:
- run: pg-start ${{ matrix.pg }}
working-directory: ./
- uses: actions/checkout@v4
- run: pgxn install 'pg_partman=4.7.3'
# - run: pgxn install 'pg_partman=${{ matrix.partman }}'
# TODO: use pgxn to install pg_partman once 5.x is available in pgxn
- run: make install-pg-partman PG_PARTMAN_VER=${{ matrix.partman }}
- run: pg-build-test

publish:
Expand Down
3 changes: 2 additions & 1 deletion pgmq-extension/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ TESTS = $(wildcard test/sql/*.sql)
REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
REGRESS_OPTS ?= --inputdir=test
EXTRA_CLEAN = $(EXTENSION)-$(EXTVERSION).zip sql/$(EXTENSION)--$(EXTVERSION).sql META.json Trunk.toml
PG_PARTMAN_VER = 5.1.0

# pg_isolation_regress available in v14 and higher.
ifeq ($(shell test $$(pg_config --version | awk '{print $$2}' | awk 'BEGIN { FS = "." }; { print $$1 }') -ge 14; echo $$?),0)
Expand Down Expand Up @@ -39,7 +40,7 @@ Trunk.toml:
install-pg-partman:
git clone https://github.com/pgpartman/pg_partman.git && \
cd pg_partman && \
git checkout v5.1.0 && \
git checkout v${PG_PARTMAN_VER} && \
make && \
make install PG_CONFIG=$(PG_CONFIG) && \
cd ../ && rm -rf pg_partman
2 changes: 1 addition & 1 deletion pgmq-extension/test/expected/base.out
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ SELECT msg_id from pgmq.read('test_set_vt_queue', 1, 1);
(1 row)

-- test_partitioned_delete
\set partition_interval 1
\set partition_interval 2
\set retention_interval 2
-- We first will drop pg_partman and assert that create fails without the
-- extension installed
Expand Down
2 changes: 1 addition & 1 deletion pgmq-extension/test/sql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ SELECT msg_id FROM pgmq.set_vt('test_set_vt_queue', :first_msg_id, 0);
SELECT msg_id from pgmq.read('test_set_vt_queue', 1, 1);

-- test_partitioned_delete
\set partition_interval 1
\set partition_interval 2
\set retention_interval 2

-- We first will drop pg_partman and assert that create fails without the
Expand Down

0 comments on commit 6fada6b

Please sign in to comment.