Skip to content

Commit

Permalink
Merge pull request #253 from pblottiere/travis
Browse files Browse the repository at this point in the history
Add travis jobs for multiple PostgreSQL / PostGIS versions
  • Loading branch information
pblottiere committed Jan 7, 2020
2 parents dda0cb9 + f55cd38 commit 49fc69e
Show file tree
Hide file tree
Showing 14 changed files with 1,970 additions and 37 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ pgsql/pointcloud.control
pgsql/pointcloud--*
pgsql_postgis/pointcloud_postgis.control
pgsql_postgis/pointcloud_postgis--*

pgsql/pc_access.bc
pgsql/pc_editor.bc
pgsql/pc_inout.bc
pgsql/pc_pgsql.bc
49 changes: 27 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
language: c
dist: trusty

before_install:
- sudo apt-get update
- sudo apt-get install -q postgresql-server-dev-9.6 libcunit1-dev valgrind
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq

install:
- sudo apt-get install -qq g++-4.8
- export CXX="g++-4.8"
- sh .install-lazperf.sh
- npm install -g eclint@1.1.5

addons:
postgresql: "9.6" # for "installcheck"
apt:
packages:
- postgresql-9.6-postgis-2.4

# Note: Valgrind currently reports many problems when libght is enabled. So for
# now, and until the problems are fixed, we just run the unit tests with libght
# enabled.
jobs:
include:
- env: POSTGRESQL_VERSION="9.6" POSTGIS_VERSION="2.5"
dist: xenial
- env: POSTGRESQL_VERSION="10" POSTGIS_VERSION="2.5"
dist: xenial
- env: POSTGRESQL_VERSION="11" POSTGIS_VERSION="2.5"
dist: xenial
- env: POSTGRESQL_VERSION="12" POSTGIS_VERSION="2.5"
dist: bionic
- env: POSTGRESQL_VERSION="12" POSTGIS_VERSION="3"
dist: bionic

script:
- sudo service postgresql stop
- sudo apt-get remove postgresql* -y
- sudo apt-get install -q postgresql-server-dev-$POSTGRESQL_VERSION postgresql-client-$POSTGRESQL_VERSION postgresql-$POSTGRESQL_VERSION-postgis-$POSTGIS_VERSION libcunit1-dev valgrind g++
- sudo pg_dropcluster --stop $POSTGRESQL_VERSION main
- sudo rm -rf /etc/postgresql/$POSTGRESQL_VERSION /var/lib/postgresql/$POSTGRESQL_VERSION
- sudo pg_createcluster -u postgres $POSTGRESQL_VERSION main -- --auth-local trust --auth-host password
- sudo /etc/init.d/postgresql start $POSTGRESQL_VERSION || sudo journalctl -xe
- psql -c 'CREATE ROLE travis SUPERUSER LOGIN CREATEDB;' -U postgres
- nvm install 8
- npm install -g eclint@1.1.5
- eclint check * */* */cunit/*
- sh .install-lazperf.sh
- ./tools/build-install.sh # test compilation without lazperf
- ./tools/build-install.sh --with-lazperf=/usr/local && make check && ./tools/valgrind.sh
- make installcheck || { cat pgsql/regression.diffs && false; }
- (cd tools/benchmark_compression && sh compression_benchmark.sh)

after_failure:
- cat pgsql/regression.out
- cat pgsql/regression.diffs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ After generating the configure script with ``autogen.sh``, ``./configure --help

Note: you can use ``--with-pgconfig`` on the ``./configure`` command line if you have multiple PostgreSQL installations on your system and want to target a specific one. For example:

- ``./configure --with-pgconfig=/usr/lib/postgresql/9.5/bin/pg_config``
- ``./configure --with-pgconfig=/usr/lib/postgresql/12/bin/pg_config``

Run unit tests:

Expand Down
2 changes: 2 additions & 0 deletions config.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ LIB_A_LAZPERF = liblazperf.a

LAZPERF_STATUS = @LAZPERF_STATUS@
LAZPERF_CPPFLAGS = @LAZPERF_CPPFLAGS@

PGSQL_MAJOR_VERSION = @PGSQL_MAJOR_VERSION@
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ PGSQL_MAJOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[[^0-9]]*\([[0-9]]*\).*/\
PGSQL_MINOR_VERSION=`echo $PGSQL_FULL_VERSION | sed 's/[[^0-9]]*\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"

AC_SUBST([PGSQL_MAJOR_VERSION])

PGSQL_PKGLIBDIR=`$PG_CONFIG --pkglibdir`
PGSQL_LIBDIR=`$PG_CONFIG --libdir`
PGSQL_SHAREDIR=`$PG_CONFIG --sharedir`
Expand Down
18 changes: 16 additions & 2 deletions pgsql/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,24 @@ DATA_built = \
$(EXTENSION)--$(EXTVERSION).sql \
$(UPGRADES)

REGRESS = pointcloud pointcloud_columns schema
REGRESS =

ifeq ("$(PGSQL_MAJOR_VERSION)", "9")
REGRESS += pointcloud_pg9
else
REGRESS += pointcloud
endif

REGRESS += pointcloud_columns schema

ifeq ("$(PGSQL_MAJOR_VERSION)", "9")
ifneq ("$(LAZPERF_STATUS)", "disabled")
REGRESS += pointcloud-laz
REGRESS += pointcloud_laz_pg9
endif
else
ifneq ("$(LAZPERF_STATUS)", "disabled")
REGRESS += pointcloud_laz
endif
endif

# Add in build/link flags for lib
Expand Down
25 changes: 13 additions & 12 deletions pgsql/expected/pointcloud.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set client_min_messages to ERROR;
SET extra_float_digits = 0;
CREATE EXTENSION pointcloud;
SELECT PC_Version();
pc_version
Expand Down Expand Up @@ -238,10 +239,10 @@ CREATE TABLE IF NOT EXISTS pt_test (
pt PCPOINT(1)
);
\d pt_test
Table "public.pt_test"
Column | Type | Modifiers
--------+------------+-----------
pt | pcpoint(1) |
Table "public.pt_test"
Column | Type | Collation | Nullable | Default
--------+------------+-----------+----------+---------
pt | pcpoint(1) | | |

DELETE FROM pt_test;
INSERT INTO pt_test (pt) VALUES ('00000000020000000100000002000000030004');
Expand Down Expand Up @@ -305,10 +306,10 @@ CREATE TABLE IF NOT EXISTS pa_test (
pa PCPATCH(1)
);
\d pa_test
Table "public.pa_test"
Column | Type | Modifiers
--------+------------+-----------
pa | pcpatch(1) |
Table "public.pa_test"
Column | Type | Collation | Nullable | Default
--------+------------+-----------+----------+---------
pa | pcpatch(1) | | |

DELETE FROM pa_test;
INSERT INTO pa_test (pa) VALUES ('0000000002000000000000000200000002000000030000000500060000000200000003000000050008');
Expand Down Expand Up @@ -377,10 +378,10 @@ CREATE TABLE IF NOT EXISTS pa_test_dim (
pa PCPATCH(3)
);
\d pa_test_dim
Table "public.pa_test_dim"
Column | Type | Modifiers
--------+------------+-----------
pa | pcpatch(3) |
Table "public.pa_test_dim"
Column | Type | Collation | Nullable | Default
--------+------------+-----------+----------+---------
pa | pcpatch(3) | | |

INSERT INTO pa_test_dim (pa) VALUES ('0000000003000000000000000200000002000000030000000500060000000200000003000000050008');
INSERT INTO pa_test_dim (pa) VALUES ('000000000300000000000000020000000600000007000000050006000000090000000A00000005000A');
Expand Down

0 comments on commit 49fc69e

Please sign in to comment.