initial support for pg_regress-based tests#2058
Merged
eeeebbbbrrrr merged 10 commits intopgcentralfoundation:developfrom May 7, 2025
Merged
initial support for pg_regress-based tests#2058eeeebbbbrrrr merged 10 commits intopgcentralfoundation:developfrom
pg_regress-based tests#2058eeeebbbbrrrr merged 10 commits intopgcentralfoundation:developfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces initial support for pg_regress-based regression tests by adding a new cargo subcommand along with accompanying templates and configuration changes. Key changes include:
- New functions in PgConfig for locating pg_regress assets and additional database operations (e.g. dropdb).
- Updates to the cargo-pgrx commands (start, run, connect, pgrx) to support runtime PostgreSQL configuration and regression testing.
- Extended documentation in the README and new file templates for regression testing.
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pgrx-pg-config/src/lib.rs | Introduces new methods (pg_regress_path and pgxs_path) and updates dropdb output formatting. |
| pgrx-examples/range/... | Adds SQL test scripts and expected outputs for regression tests. |
| cargo-pgrx/src/command/* | Updates commands to accept and pass through runtime PostgreSQL configuration, and adds the new regress subcommand. |
| cargo-pgrx/src/templates/* | Adds new templates for setup_sql and setup_out. |
| cargo-pgrx/README.md | Enhances documentation with detailed regression testing instructions. |
| Cargo.toml | Adds a dependency on "which". |
Contributor
Author
Contributor
Author
|
CI is red because I cancelled the jobs. I'm going to merge this through and then start a new release. |
a903aad
into
pgcentralfoundation:develop
4 of 15 checks passed
eeeebbbbrrrr
added a commit
that referenced
this pull request
May 7, 2025
Welcome to pgrx v0.14.2. This is a minor release that fixes a few bugs and also adds a big new feature: support for `pg_regress`-based regression tests. As always, please update with `cargo install cargo-pgrx --version 0.14.2 --locked` and update your extension `Cargo.toml` files with `cargo pgrx upgrade`. For the `pg_regress` regression test support, there's a new `cargo pgrx regress` subcommand, and it's documented in [cargo-pgrx's readme](https://github.com/pgcentralfoundation/pgrx/blob/develop/cargo-pgrx/README.md#testing-with-regression-tests). ## What's Changed * Remove the `$libdir/` prefix from module_pathname by @theory in #2051 This will help with the upcoming Postgres v18 and generally makes pgrx-based extensions less restrictive with regard to how they're installed. * initial support for `pg_regress`-based tests by @eeeebbbbrrrr in #2058 (editor's node: I full expect users to uncover UX nits with this and am more than happy to entertain any ideas that help to improve workflows, either locally during development or in CI. Feel free to open issues about it.) ### More Bindings * Include `pg_statistic_ext` catalog by @ArArgon in #2053 ### Bug Fixes * check `tgnargs` in `extra_args` by @usamoi in #2046 ### Code Cleanup * Added absolute path to call `<Self as ::pgrx::datum::FromDatum>::` by @LucaCappelletti94 in #2050 * Removed duplicate ok check by @YohDeadfall in #2044 ## New Contributors * @LucaCappelletti94 made their first contribution in #2050 * @ArArgon made their first contribution in #2053 ## Thanks Shoutout to @philippemnoel of @paradedb for paying me to implement the `pg_regress` support. ❤️ **Full Changelog**: v0.14.1...v0.14.2
KenjiBrown
pushed a commit
to SoftwareLibreMx/pgrx
that referenced
this pull request
May 27, 2025
This adds a new `cargo pgrx regress` subcommand that knows how to manage/run sql-based tests compatible with Postgres' `pg_regress` tool (which this uses).
KenjiBrown
pushed a commit
to SoftwareLibreMx/pgrx
that referenced
this pull request
May 27, 2025
Welcome to pgrx v0.14.2. This is a minor release that fixes a few bugs and also adds a big new feature: support for `pg_regress`-based regression tests. As always, please update with `cargo install cargo-pgrx --version 0.14.2 --locked` and update your extension `Cargo.toml` files with `cargo pgrx upgrade`. For the `pg_regress` regression test support, there's a new `cargo pgrx regress` subcommand, and it's documented in [cargo-pgrx's readme](https://github.com/pgcentralfoundation/pgrx/blob/develop/cargo-pgrx/README.md#testing-with-regression-tests). ## What's Changed * Remove the `$libdir/` prefix from module_pathname by @theory in pgcentralfoundation#2051 This will help with the upcoming Postgres v18 and generally makes pgrx-based extensions less restrictive with regard to how they're installed. * initial support for `pg_regress`-based tests by @eeeebbbbrrrr in pgcentralfoundation#2058 (editor's node: I full expect users to uncover UX nits with this and am more than happy to entertain any ideas that help to improve workflows, either locally during development or in CI. Feel free to open issues about it.) ### More Bindings * Include `pg_statistic_ext` catalog by @ArArgon in pgcentralfoundation#2053 ### Bug Fixes * check `tgnargs` in `extra_args` by @usamoi in pgcentralfoundation#2046 ### Code Cleanup * Added absolute path to call `<Self as ::pgrx::datum::FromDatum>::` by @LucaCappelletti94 in pgcentralfoundation#2050 * Removed duplicate ok check by @YohDeadfall in pgcentralfoundation#2044 ## New Contributors * @LucaCappelletti94 made their first contribution in pgcentralfoundation#2050 * @ArArgon made their first contribution in pgcentralfoundation#2053 ## Thanks Shoutout to @philippemnoel of @paradedb for paying me to implement the `pg_regress` support. ❤️ **Full Changelog**: pgcentralfoundation/pgrx@v0.14.1...v0.14.2
daamien
pushed a commit
to daamien/pgrx
that referenced
this pull request
Dec 15, 2025
This adds a new `cargo pgrx regress` subcommand that knows how to manage/run sql-based tests compatible with Postgres' `pg_regress` tool (which this uses).
daamien
pushed a commit
to daamien/pgrx
that referenced
this pull request
Dec 15, 2025
Welcome to pgrx v0.14.2. This is a minor release that fixes a few bugs and also adds a big new feature: support for `pg_regress`-based regression tests. As always, please update with `cargo install cargo-pgrx --version 0.14.2 --locked` and update your extension `Cargo.toml` files with `cargo pgrx upgrade`. For the `pg_regress` regression test support, there's a new `cargo pgrx regress` subcommand, and it's documented in [cargo-pgrx's readme](https://github.com/pgcentralfoundation/pgrx/blob/develop/cargo-pgrx/README.md#testing-with-regression-tests). ## What's Changed * Remove the `$libdir/` prefix from module_pathname by @theory in pgcentralfoundation#2051 This will help with the upcoming Postgres v18 and generally makes pgrx-based extensions less restrictive with regard to how they're installed. * initial support for `pg_regress`-based tests by @eeeebbbbrrrr in pgcentralfoundation#2058 (editor's node: I full expect users to uncover UX nits with this and am more than happy to entertain any ideas that help to improve workflows, either locally during development or in CI. Feel free to open issues about it.) ### More Bindings * Include `pg_statistic_ext` catalog by @ArArgon in pgcentralfoundation#2053 ### Bug Fixes * check `tgnargs` in `extra_args` by @usamoi in pgcentralfoundation#2046 ### Code Cleanup * Added absolute path to call `<Self as ::pgrx::datum::FromDatum>::` by @LucaCappelletti94 in pgcentralfoundation#2050 * Removed duplicate ok check by @YohDeadfall in pgcentralfoundation#2044 ## New Contributors * @LucaCappelletti94 made their first contribution in pgcentralfoundation#2050 * @ArArgon made their first contribution in pgcentralfoundation#2053 ## Thanks Shoutout to @philippemnoel of @paradedb for paying me to implement the `pg_regress` support. ❤️ **Full Changelog**: pgcentralfoundation/pgrx@v0.14.1...v0.14.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This adds a new
cargo pgrx regresssubcommand that knows how to manage/run sql-based tests compatible with Postgres'pg_regresstool (which this uses).I'd expect there to be some UX issues here that will need to be addressed in future commits/releases, but this feature needs to start somewhere.