Skip to content

feat: CI pipeline and regression tests (PG 14-17)#12

Merged
NikolayS merged 2 commits intomainfrom
feat/5-ci-tests
Apr 13, 2026
Merged

feat: CI pipeline and regression tests (PG 14-17)#12
NikolayS merged 2 commits intomainfrom
feat/5-ci-tests

Conversation

@NikolayS
Copy link
Copy Markdown
Owner

Summary

  • Add GitHub Actions CI workflow (.github/workflows/ci.yml) that tests pgque on PostgreSQL 14, 15, 16, and 17 using Docker
  • Create regression test suite (tests/run_all.sql + 8 test files) covering config, roles, security definer, queue lifecycle, events, ticker, consumers, and retry mechanism
  • Fix xid8 cast bug in batch_event_sql dynamic SQL that broke event retrieval after the bigint-to-xid8 transform
  • CI also verifies install idempotency, uninstall, SECURITY DEFINER search_path, and no stale pgq/txid references

Bug fix: xid8 casts in batch_event_sql

The bigint->xid8 transform for ev_txid left the dynamic SQL in batch_event_sql generating comparisons like ev.ev_txid >= 12345, which fail because PostgreSQL has no comparison operator for (xid8, integer). Fixed by emitting '12345'::xid8 text-cast literals.

Test suite

All tests verified locally on PostgreSQL 17:

=== pgque regression test suite ===
PASS: pgque_config
PASS: pgque_roles
PASS: config table / queue_max_retries / roles / version()
PASS: security_definer - all functions have search_path
PASS: core_lifecycle
PASS: core_events
PASS: core_ticker
PASS: core_consumer
PASS: core_retry
PASS: install idempotency (5 sub-tests)
=== ALL TESTS PASSED ===

Closes #5

Test plan

  • CI runs green on all PG versions (14, 15, 16, 17)
  • verify job passes static checks (SECURITY DEFINER, no pgq refs, no txid refs)
  • Install idempotency: running install twice produces no errors
  • Uninstall removes the pgque schema cleanly

🤖 Generated with Claude Code

NikolayS and others added 2 commits April 13, 2026 07:39
After the bigint->xid8 transform for ev_txid, the dynamic SQL
in batch_event_sql generates comparisons like
ev.ev_txid >= 12345 which fail because PostgreSQL has no
comparison operator for (xid8, integer). Fix by emitting
'12345'::xid8 text-cast literals in the generated SQL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GitHub Actions CI testing on PG 14-17 with Docker.
Regression test suite covering: config, roles, security
definer, queue lifecycle, events, ticker, consumers,
retry mechanism, and install idempotency.

Closes #5

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@NikolayS
Copy link
Copy Markdown
Owner Author

REV Code Review Report

  • PR: NikolayS/pgque#12 — feat: CI pipeline and regression tests (PG 14-17)
  • Author: @NikolayS
  • Branch: feat/5-ci-tests
  • CI: ⚪ first CI setup — will validate on merge

BLOCKING ISSUES (0)

None. The xid8 bug fix is correct and the test suite is solid.


NON-BLOCKING (4)

LOW .github/workflows/ci.yml — Missing PG 18 in matrix (CLAUDE.md says PG 14-18). Add '18' when stable image available.

MEDIUM .github/workflows/ci.ymlpsql -f calls outside run_all.sql lack ON_ERROR_STOP. If install emits SQL errors, CI passes silently. Add -v ON_ERROR_STOP=1 to all psql invocations.

LOW .github/workflows/ci.ymlpg_isready wait loop lacks failure exit on timeout. Add || { echo "PG failed to start"; exit 1; } after the loop.

LOW .github/workflows/ci.yml — Verify job SECURITY DEFINER grep is line-based (fragile). The runtime check in test_security_definer.sql is authoritative.


POTENTIAL ISSUES (2)

LOW test_core_ticker.sql queries pgque.tick directly (internal table) (confidence: 5/10)
LOW Retry test uses 0-second delay — doesn't exercise real timing (confidence: 4/10)


xid8 Bug Fix Assessment

The critical fix in batch_event_sql is correct:

  • ev.ev_txid >= 12345ev.ev_txid >= '12345'::xid8 — proper type casting
  • IN() list values also get ::xid8 casts
  • Dynamic SQL quoting is correct (PL/pgSQL string concatenation with '''' for single quotes)
  • All tests pass on PG 17 locally

Summary

Area Findings Potential Filtered
Security 0 0 0
Bugs 0 0 0
Tests 0 2 0
CI 4 (non-blocking) 0 0
Guidelines 0 0 0

Verdict: PASSED. No blockers. The non-blocking CI improvements should be addressed in a follow-up PR.


REV-assisted review (AI analysis by postgres-ai/rev)

@NikolayS NikolayS merged commit 5251f21 into main Apr 13, 2026
5 checks passed
@NikolayS NikolayS deleted the feat/5-ci-tests branch April 16, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI pipeline and regression test suite (PG 14–18)

1 participant