Skip to content

Commit 102488d

Browse files
committed
Fix broken Makefile REGRESS list and CI package conflict
Two problems were leaving main red / unbuildable: 1. Merging PRs #68, #69 and #70 mis-resolved the REGRESS list. A missing line-continuation backslash after semaphore_validation left schema_install dangling, which made `make` itself fail with "missing separator", and the six subsystem tests added in #68 (free_memory, signals, ipc, semaphore_wait, scheduler, power) were dropped from the list even though their sql/ and expected/ files were committed. Rebuild the list with every test (21 total) and correct continuations. `make installcheck` is green again. 2. The CI workflow installed postgresql-server-dev-all, whose dependency on the archive's postgresql-common conflicts with the newer PGDG postgresql-common already present on the runner image, so the install step aborted before any test ran. Install versioned PGDG packages (postgresql-16 + postgresql-server-dev-16), detect the cluster's actual port, and pin PG_CONFIG so build, install and installcheck all target the same server. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ty3Rkif9Vfe95w8TMiKB4b
1 parent f9615fb commit 102488d

2 files changed

Lines changed: 35 additions & 14 deletions

File tree

.github/workflows/test.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
pull_request:
66

7+
env:
8+
PG_MAJOR: "16"
9+
710
jobs:
811
test:
912
runs-on: ubuntu-latest
@@ -13,30 +16,42 @@ jobs:
1316
- name: Install PostgreSQL and development headers
1417
run: |
1518
sudo apt-get update
16-
# Server, contrib modules, client library and the PGXS build headers
17-
sudo apt-get install -y postgresql postgresql-contrib libpq-dev postgresql-server-dev-all
18-
19-
- name: Start PostgreSQL
19+
# The GitHub runner image already has the PGDG apt repo and a newer
20+
# postgresql-common, which conflicts with the archive's
21+
# postgresql-server-dev-all meta-package. Install versioned packages
22+
# so apt stays on the PGDG line.
23+
sudo apt-get install -y \
24+
"postgresql-${PG_MAJOR}" \
25+
"postgresql-server-dev-${PG_MAJOR}" \
26+
libpq-dev
27+
28+
- name: Start the PostgreSQL cluster
2029
run: |
21-
# Determine the installed major version and start the default cluster
22-
PG_MAJOR=$(pg_config --version | awk '{print $2}' | cut -d. -f1)
23-
echo "PG_MAJOR=$PG_MAJOR" >> "$GITHUB_ENV"
24-
sudo pg_ctlcluster "$PG_MAJOR" main start
30+
# The cluster may already exist on the runner; create it only if not.
31+
if ! pg_lsclusters -h | awk '{print $1, $2}' | grep -qx "${PG_MAJOR} main"; then
32+
sudo pg_createcluster "${PG_MAJOR}" main
33+
fi
34+
sudo pg_ctlcluster "${PG_MAJOR}" main start || true
35+
# Whatever port the cluster ended up on, route all later steps to it.
36+
PORT=$(pg_lsclusters -h | awk -v v="${PG_MAJOR}" '$1==v && $2=="main" {print $3}')
37+
echo "PGHOST=/var/run/postgresql" >> "$GITHUB_ENV"
38+
echo "PGPORT=$PORT" >> "$GITHUB_ENV"
2539
2640
- name: Create a superuser role for the runner
2741
run: |
2842
# pg_regress connects over the local socket as the current OS user via
2943
# peer authentication, so that user needs a matching superuser role.
30-
sudo -u postgres createuser --superuser "$(whoami)"
31-
sudo -u postgres createdb "$(whoami)"
44+
sudo -u postgres psql -p "$PGPORT" -d postgres \
45+
-c "CREATE ROLE \"$(whoami)\" SUPERUSER LOGIN;" || true
46+
sudo -u postgres createdb -p "$PGPORT" -O "$(whoami)" "$(whoami)" || true
3247
3348
- name: Build and install the extension
3449
run: |
35-
make
36-
sudo make install
50+
make PG_CONFIG="/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config"
51+
sudo make PG_CONFIG="/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config" install
3752
3853
- name: Run regression tests
39-
run: make installcheck
54+
run: make PG_CONFIG="/usr/lib/postgresql/${PG_MAJOR}/bin/pg_config" installcheck
4055

4156
- name: Show regression diffs on failure
4257
if: failure()

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@ REGRESS = pg_os_basic \
55
create_user \
66
check_permission \
77
create_process \
8+
scheduler \
9+
signals \
810
allocate_memory \
911
allocate_page \
12+
free_memory \
1013
free_all_memory_for_process \
1114
create_file \
1215
file_versioning \
1316
lock_file \
17+
ipc \
1418
load_unload_module \
1519
modules \
20+
semaphore_wait \
21+
semaphore_validation \
22+
power \
1623
locks_security \
17-
semaphore_validation
1824
schema_install
1925
REGRESS_OPTS = --outputdir=$(CURDIR)/tmp_pg_os_regress
2026
PGXS := $(shell $(PG_CONFIG) --pgxs)

0 commit comments

Comments
 (0)