-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pgrx test and reorganize PGXS tests
Move the PGXS tests to a subdirectory separate testing PGXS from testing zip vs. Git bundling in `cicd.yml`. Then add a pgrx "hello world" project in `test/pgrx` and test it, too, including `pg_regress` tests. Update `/etc/sudoers` and the `PATH` environment variable to allow otherwise unprivileged users to do what they need to do. Copy-edit the README a bit and explicitly set the PATH environment variable in the `Dockerfile`, because `/etc/profile.d` scripts apparently don't run in GitHub workflows.
- Loading branch information
Showing
23 changed files
with
216 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.gitignore export-ignore | ||
.gitattributes export-ignore | ||
.github export-ignore | ||
/runtest.sh export-ignore | ||
runtest.sh export-ignore |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[target.'cfg(target_os="macos")'] | ||
# Postgres symbols won't be available until runtime | ||
rustflags = ["-Clink-arg=-Wl,-undefined,dynamic_lookup"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.DS_Store | ||
.idea/ | ||
/target | ||
*.iml | ||
**/*.rs.bk | ||
Cargo.lock | ||
regression.* | ||
results/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[package] | ||
name = "hello" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[features] | ||
default = ["pg13"] | ||
pg11 = ["pgrx/pg11", "pgrx-tests/pg11" ] | ||
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ] | ||
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ] | ||
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ] | ||
pg15 = ["pgrx/pg15", "pgrx-tests/pg15" ] | ||
pg16 = ["pgrx/pg16", "pgrx-tests/pg16" ] | ||
pg_test = [] | ||
|
||
[dependencies] | ||
pgrx = "=0.11.4" | ||
|
||
[dev-dependencies] | ||
pgrx-tests = "=0.11.4" | ||
|
||
[profile.dev] | ||
panic = "unwind" | ||
|
||
[profile.release] | ||
panic = "unwind" | ||
opt-level = 3 | ||
lto = "fat" | ||
codegen-units = 1 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
EXTENSION = hello | ||
EXTVERSION = 0.1.0 | ||
TESTS = test/sql/base.sql | ||
REGRESS = base | ||
REGRESS_OPTS = --inputdir=test --load-extension=$(EXTENSION) | ||
PG_CONFIG = pg_config | ||
|
||
PGXS := $(shell $(PG_CONFIG) --pgxs) | ||
include $(PGXS) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
comment = 'hello: Created by pgrx' | ||
default_version = '@CARGO_VERSION@' | ||
module_pathname = '$libdir/hello' | ||
relocatable = false | ||
superuser = true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SELECT hello_hello(); | ||
hello_hello | ||
-------------- | ||
Hello, hello | ||
(1 row) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
pgversion=$1 | ||
cd "$(dirname "$0")" | ||
pg-start "$pgversion" | ||
pgrx-build-test |
Oops, something went wrong.