-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Quack test environment (#35)
* Move regression test to test/regression directory. Running test will now start temporary PG instance for which we can now add custom configuration. Quack extension will now be loaded when instance starts. * Make with required lz4 library * gha: add ccache, move install build deps to separate step --------- Co-authored-by: Jonathan Dance <[email protected]>
- Loading branch information
Showing
12 changed files
with
87 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
name: pg_quack Build and Test | ||
on: | ||
push: | ||
pull_request: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build-and-test: | ||
strategy: | ||
|
@@ -15,31 +16,33 @@ jobs: | |
- name: Test details | ||
run: echo Build and test pg_quack on ${{ matrix.os }} with PostgreSQL ${{ matrix.version }} branch | ||
|
||
- name: Checkout and build PostgreSQL code | ||
- name: Install build deps | ||
run: | | ||
sudo apt-get update -qq | ||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 | ||
sudo apt-get install -y build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev libxml2-utils xsltproc ccache pkg-config libc++-dev libc++abi-dev libglib2.0-dev libtinfo5 cmake libstdc++-12-dev | ||
rm -rf postgres | ||
git clone --branch ${{ matrix.version }} --single-branch --depth 1 https://github.com/postgres/postgres.git | ||
pushd postgres | ||
git branch | ||
./configure --prefix=$PWD/inst/ --enable-cassert --enable-debug --with-openssl | ||
make -j4 install | ||
sudo apt-get install -y build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev \ | ||
libssl-dev libxml2-utils xsltproc pkg-config libc++-dev libc++abi-dev libglib2.0-dev libtinfo5 cmake \ | ||
libstdc++-12-dev | ||
- name: Start Postgres | ||
run: | | ||
pushd postgres | ||
cd inst/bin | ||
./initdb -D data | ||
./pg_ctl -D data -l logfile start | ||
popd | ||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
create-symlink: true | ||
|
||
- name: Checkout pg_quack extension code | ||
uses: actions/checkout@v4 | ||
with: | ||
path: quack | ||
|
||
- name: Checkout and build PostgreSQL code | ||
run: | | ||
rm -rf postgres | ||
git clone --branch ${{ matrix.version }} --single-branch --depth 1 https://github.com/postgres/postgres.git | ||
pushd postgres | ||
git branch | ||
./configure --prefix=$PWD/inst/ --enable-cassert --enable-debug --with-openssl | ||
make -j8 install | ||
- name: Build and test pg_quack extension | ||
id: regression-tests | ||
run: | | ||
|
@@ -54,4 +57,4 @@ jobs: | |
- name: Print regression.diffs if regression tests failed | ||
if: failure() && steps.regression-tests.outcome != 'success' | ||
run: | | ||
cat quack/regression.diffs | ||
cat quack/test/regression/regression.diffs |
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 |
---|---|---|
|
@@ -9,8 +9,4 @@ compile_commands.json | |
*.so | ||
*.o | ||
*.bc | ||
*.dylib | ||
|
||
results | ||
regression.diffs | ||
regression.out | ||
*.dylib |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
PG_CONFIG ?= pg_config | ||
|
||
PGXS := $(shell $(PG_CONFIG) --pgxs) | ||
PG_LIB := $(shell $(PG_CONFIG) --pkglibdir) | ||
INCLUDEDIR := ${shell $(PG_CONFIG) --includedir} | ||
INCLUDEDIR_SERVER := ${shell $(PG_CONFIG) --includedir-server} | ||
|
||
USE_PGXS = 1 | ||
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,12 @@ | ||
# Generated subdirectories | ||
/tmp_check/ | ||
/results/ | ||
/log/ | ||
|
||
# Regression test output | ||
/regression.diffs | ||
/regression.output | ||
/regression.out | ||
|
||
# core dumps | ||
core |
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,18 @@ | ||
# Makefile for regression test | ||
|
||
ROOT_DIR = ../.. | ||
|
||
include $(ROOT_DIR)/Makefile.global | ||
|
||
check-regression-quack: | ||
TEST_DIR=$(CURDIR) $(pg_regress_check) \ | ||
--temp-config regression.conf \ | ||
--load-extension=quack \ | ||
--schedule schedule | ||
|
||
clean-regression: | ||
rm -fr $(CURDIR)/tmp_check | ||
rm -fr $(CURDIR)/log | ||
rm -fr $(CURDIR)/results | ||
rm -f $(CURDIR)/regression.diffs | ||
rm -f $(CURDIR)/regression.out |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Configuration | ||
|
||
shared_preload_libraries = 'quack' | ||
log_temp_files = -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,2 @@ | ||
test: basic | ||
test: search_path |
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