-
Notifications
You must be signed in to change notification settings - Fork 1
Switch to pgxn-tools based testing #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
fa15ccb
99083b8
aa53b91
68e8afc
9859566
9a1e50b
594d248
a217824
8dc5cfc
728f815
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: CI | ||
| on: [push, pull_request] | ||
| jobs: | ||
| test: | ||
| strategy: | ||
| matrix: | ||
| pg: [17, 16, 15, 14, 13, 12, 11, 10] | ||
| name: 🐘 PostgreSQL ${{ matrix.pg }} | ||
| runs-on: ubuntu-latest | ||
| container: pgxn/pgxn-tools | ||
| steps: | ||
| - name: Start PostgreSQL ${{ matrix.pg }} | ||
| run: pg-start ${{ matrix.pg }} | ||
| - name: Check out the repo | ||
| uses: actions/checkout@v4 | ||
| - name: Test on PostgreSQL ${{ matrix.pg }} | ||
| run: make test PGUSER=postgres | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,3 +28,4 @@ regression.out | |
| # Misc | ||
| tmp/ | ||
| .DS_Store | ||
| .claude/settings.local.json | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -36,7 +36,7 @@ TEST_SQL_FILES += $(wildcard $(TESTDIR)/sql/*.sql) | |||||||||||||||||||||||
| TEST_RESULT_FILES = $(patsubst $(TESTDIR)/sql/%.sql,$(TESTDIR)/expected/%.out,$(TEST_SQL_FILES)) | ||||||||||||||||||||||||
| TEST_FILES = $(TEST_SOURCE_FILES) $(TEST_SQL_FILES) | ||||||||||||||||||||||||
| REGRESS = $(sort $(notdir $(subst .source,,$(TEST_FILES:.sql=)))) # Sort is to get unique list | ||||||||||||||||||||||||
| REGRESS_OPTS = --inputdir=$(TESTDIR) --outputdir=$(TESTOUT) --load-language=plpgsql | ||||||||||||||||||||||||
| REGRESS_OPTS = --inputdir=$(TESTDIR) --outputdir=$(TESTOUT) # See additional setup below | ||||||||||||||||||||||||
| MODULES = $(patsubst %.c,%,$(wildcard src/*.c)) | ||||||||||||||||||||||||
| ifeq ($(strip $(MODULES)),) | ||||||||||||||||||||||||
| MODULES =# Set to NUL so PGXS doesn't puke | ||||||||||||||||||||||||
|
|
@@ -57,8 +57,10 @@ GE91 = $(call test, $(MAJORVER), -ge, 91) | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ifeq ($(GE91),yes) | ||||||||||||||||||||||||
| all: $(EXTENSION_VERSION_FILES) | ||||||||||||||||||||||||
| endif | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #DATA = $(wildcard sql/*--*.sql) | ||||||||||||||||||||||||
| ifeq ($($call test, $(MAJORVER), -lt 13), yes) | ||||||||||||||||||||||||
| REGRESS_OPTS += --load-language=plpgsql | ||||||||||||||||||||||||
| endif | ||||||||||||||||||||||||
|
Comment on lines
+60
to
64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win Fix Makefile syntax error: Line 62 has two defects that prevent the version-gated
Compare with the correct pattern on line 56: 🐛 Proposed fix for line 62-ifeq ($($call test, $(MAJORVER), -lt 13), yes)
+ifeq ($(call test, $(MAJORVER), -lt, 130), yes)
REGRESS_OPTS += --load-language=plpgsql
endif📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| PGXS := $(shell $(PG_CONFIG) --pgxs) | ||||||||||||||||||||||||
|
|
@@ -77,8 +79,12 @@ installcheck: $(TEST_RESULT_FILES) $(TEST_OUT_FILES) $(TEST_SQL_FILES) $(TEST_SO | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # make test: run any test dependencies, then do a `make install installcheck`. | ||||||||||||||||||||||||
| # If regressions are found, it will output them. | ||||||||||||||||||||||||
| # | ||||||||||||||||||||||||
| # This used to depend on clean as well, but that causes problems with | ||||||||||||||||||||||||
| # watch-make if you're generating intermediate files. If tests end up needing | ||||||||||||||||||||||||
| # clean it's an indication of a missing dependency anyway. | ||||||||||||||||||||||||
| .PHONY: test | ||||||||||||||||||||||||
| test: clean testdeps install installcheck | ||||||||||||||||||||||||
| test: testdeps install installcheck | ||||||||||||||||||||||||
| @if [ -r $(TESTOUT)/regression.diffs ]; then cat $(TESTOUT)/regression.diffs; fi | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # make results: runs `make test` and copy all result files to expected | ||||||||||||||||||||||||
|
|
@@ -220,6 +226,6 @@ installcheck: pgtap | |||||||||||||||||||||||
| pgtap: $(DESTDIR)$(datadir)/extension/pgtap.control | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| $(DESTDIR)$(datadir)/extension/pgtap.control: | ||||||||||||||||||||||||
| pgxn install pgtap | ||||||||||||||||||||||||
| pgxn install pgtap --sudo | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| endif # fndef PGXNTOOL_NO_PGXS_INCLUDE | ||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win
Pin container image and action, and disable credential persistence.
The
pgxn/pgxn-toolscontainer andactions/checkout@v4are referenced by tag rather than by immutable digest/SHA, which is a supply-chain risk. Additionally,actions/checkoutpersists theGITHUB_TOKENin the local git config by default; since this job doesn't push, setpersist-credentials: false.🔒️ Proposed fix
🧰 Tools
🪛 zizmor (1.26.1)
[warning] 14-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 13-13: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 10-10: unpinned image references (unpinned-images): container image is unpinned
(unpinned-images)
🤖 Prompt for AI Agents
Source: Linters/SAST tools