Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PostGIS 3.2, 3.3 & 3.4 testing #67

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 155 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,59 +17,204 @@ jobs:
- php: '8.0'
postgres: '11'
postgis: '3.0'
phpunit-flags: '--exclude-group=postgis-3.1'
phpunit-flags: '--exclude-group=versioned'
composer-flags: '--prefer-stable --prefer-lowest'
- php: '8.0'
postgres: '11'
postgis: '3.0'
phpunit-flags: '--group=postgis-3.0'
composer-flags: '--prefer-stable --prefer-lowest'

# PostgresSQL / PostGIS matrix with ORM
# PHP 8.1, Postgres 11, ORM 2.9
- php: '8.1'
postgres: '11'
postgis: '3.0'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '11'
postgis: '3.0'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.1'
phpunit-flags: '--group=postgis-3.0'
- php: '8.1'
postgres: '11'
postgis: '3.1'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '11'
postgis: '3.1'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.0'
phpunit-flags: '--group=postgis-3.1'
- php: '8.1'
postgres: '11'
postgis: '3.2'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '11'
postgis: '3.2'
orm: '2.9'
phpunit-flags: '--group=postgis-3.2'
- php: '8.1'
postgres: '11'
postgis: '3.3'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '11'
postgis: '3.3'
orm: '2.9'
phpunit-flags: '--group=postgis-3.3'
- php: '8.1'
postgres: '11'
postgis: '3.4'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '11'
postgis: '3.4'
orm: '2.9'
phpunit-flags: '--group=postgis-3.4'
# PHP 8.1, Postgres 12, ORM 2.9
- php: '8.1'
postgres: '12'
postgis: '3.0'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.1'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '12'
postgis: '3.0'
orm: '2.9'
phpunit-flags: '--group=postgis-3.0'
- php: '8.1'
postgres: '12'
postgis: '3.1'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '12'
postgis: '3.1'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.0'
phpunit-flags: '--group=postgis-3.1'
- php: '8.1'
postgres: '12'
postgis: '3.2'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '12'
postgis: '3.2'
orm: '2.9'
phpunit-flags: '--group=postgis-3.2'
- php: '8.1'
postgres: '12'
postgis: '3.3'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '12'
postgis: '3.3'
orm: '2.9'
phpunit-flags: '--group=postgis-3.3'
- php: '8.1'
postgres: '12'
postgis: '3.4'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '12'
postgis: '3.4'
orm: '2.9'
phpunit-flags: '--group=postgis-3.4'
# PHP 8.1, Postgres 13, ORM 2.9
- php: '8.1'
postgres: '13'
postgis: '3.0'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '13'
postgis: '3.0'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.1'
phpunit-flags: '--group=postgis-3.0'
- php: '8.1'
postgres: '13'
postgis: '3.1'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.0'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '13'
postgis: '3.1'
orm: '2.9'
phpunit-flags: '--group=postgis-3.1'
- php: '8.1'
postgres: '13'
postgis: '3.2'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '13'
postgis: '3.2'
orm: '2.9'
phpunit-flags: '--group=postgis-3.2'
- php: '8.1'
postgres: '13'
postgis: '3.3'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
- php: '8.1'
postgres: '13'
postgis: '3.3'
orm: '2.9'
phpunit-flags: '--group=postgis-3.3'
- php: '8.1'
postgres: '13'
postgis: '3.4'
orm: '2.9'
phpunit-flags: '--exclude-group=versioned'
code-coverage: 'yes'
- php: '8.1'
postgres: '13'
postgis: '3.4'
orm: '2.9'
phpunit-flags: '--group=postgis-3.4'
code-coverage: 'yes'

# DBAL only
- php: '8.1'
postgres: '11'
postgis: '3.0'
dbal: '2.13'
phpunit-flags: '--exclude-group=postgis-3.1 --exclude-group=orm'
phpunit-flags: '--exclude-group=versioned,orm'
- php: '8.1'
postgres: '11'
postgis: '3.0'
dbal: '2.13'
phpunit-flags: '--group=postgis-3.0 --exclude-group=orm'
- php: '8.1'
postgres: '13'
postgis: '3.1'
dbal: '3.1'
phpunit-flags: '--exclude-group=versioned,orm'
- php: '8.1'
postgres: '13'
postgis: '3.1'
dbal: '3.1'
phpunit-flags: '--exclude-group=postgis-3.0 --exclude-group=orm'
phpunit-flags: '--group=postgis-3.1 --exclude-group=orm'

# Next PHP version
- php: '8.2'
postgres: '13'
postgis: '3.1'
phpunit-flags: '--exclude-group=postgis-3.0'
phpunit-flags: '--exclude-group=versioned'
composer-flags: '--ignore-platform-reqs'
experimental: true
- php: '8.2'
postgres: '13'
postgis: '3.1'
phpunit-flags: '--group=postgis-3.1'
composer-flags: '--ignore-platform-reqs'
experimental: true
services:
Expand Down
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ Supported Versions
The following table shows the versions which are officially supported by this
library.

| Dependency | Supported Versions |
|:--------------|:--------------------|
| PostGIS | 3.0 and 3.1 |
| PostgreSQL | 11, 12 and 13 |
| Doctrine ORM | ^2.9 |
| Doctrine DBAL | ^2.13 and ^3.1 |
| Dependency | Supported Versions |
|:--------------|:---------------------------|
| PostGIS | 3.0, 3.1, 3.2, 3.3 and 3.4 |
| PostgreSQL | 11, 12 and 13 |
| Doctrine ORM | ^2.9 |
| Doctrine DBAL | ^2.13 and ^3.1 |

Installation
--
Expand Down Expand Up @@ -316,15 +316,21 @@ The script names follow the pattern
To run the test suite against PostgreSQL 13 with PostGIS 3.1, use the script
`./docker/run-13-31.sh`.

Tests are either PostGIS version specific (versioned) or agnostic, and are run
separately using PHPUnit groups.

e.g. for PostGIS 3.1 and PostgreSQL 13

```bash
./docker/run-13-31.sh vendor/bin/phpunit --exclude-group=postgis-3.0
./docker/run-13-31.sh vendor/bin/phpunit --exclude-group=versioned
./docker/run-13-31.sh vendor/bin/phpunit --group=postgis-3.1
```

Note, that we exclude tests targeted at PostGIS 3.0 here. When running tests
against PostGIS 3.0, exclude the tests for 3.1.
e.g. for PostGIS 3.0 and PostgreSQL 13

```bash
./docker/run-13-30.sh vendor/bin/phpunit --exclude-group=postgis-3.1
./docker/run-13-30.sh vendor/bin/phpunit --exclude-group=versioned
./docker/run-13-30.sh vendor/bin/phpunit --group=postgis-3.0
```

License
Expand Down
30 changes: 30 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,27 @@ services:
networks:
- db-13-31

db-13-32:
image: postgis/postgis:13-3.2-alpine
environment:
POSTGRES_PASSWORD: postgres
networks:
- db-13-32

db-13-33:
image: postgis/postgis:13-3.3-alpine
environment:
POSTGRES_PASSWORD: postgres
networks:
- db-13-33

db-13-34:
image: postgis/postgis:13-3.4-alpine
environment:
POSTGRES_PASSWORD: postgres
networks:
- db-13-34

networks:
db-11-30:
name: doctrine-postgis-11-30
Expand All @@ -62,3 +83,12 @@ networks:
db-13-31:
name: doctrine-postgis-13-31
driver: bridge
db-13-32:
name: doctrine-postgis-13-32
driver: bridge
db-13-33:
name: doctrine-postgis-13-33
driver: bridge
db-13-34:
name: doctrine-postgis-13-34
driver: bridge
11 changes: 11 additions & 0 deletions docker/run-13-32.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

echo "
Running with:

* Postgres 13
* PostGIS 3.2
"

docker run -it --rm --network doctrine-postgis-13-32 -e DB_HOST=db-13-32 -v "${PWD}":/app doctrine-postgis-php "$@"
11 changes: 11 additions & 0 deletions docker/run-13-33.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

echo "
Running with:

* Postgres 13
* PostGIS 3.3
"

docker run -it --rm --network doctrine-postgis-13-33 -e DB_HOST=db-13-33 -v "${PWD}":/app doctrine-postgis-php "$@"
11 changes: 11 additions & 0 deletions docker/run-13-34.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

echo "
Running with:

* Postgres 13
* PostGIS 3.4
"

docker run -it --rm --network doctrine-postgis-13-34 -e DB_HOST=db-13-34 -v "${PWD}":/app doctrine-postgis-php "$@"
5 changes: 5 additions & 0 deletions tests/Functions/ST_3DClosestPointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ protected function setUp(): void

/**
* @group postgis-3.0
* @group versioned
*/
public function testQuery1(): void
{
Expand Down Expand Up @@ -80,6 +81,10 @@ public function testQuery1(): void

/**
* @group postgis-3.1
* @group postgis-3.2
* @group postgis-3.3
* @group postgis-3.4
* @group versioned
*/
public function testQuery2(): void
{
Expand Down
5 changes: 5 additions & 0 deletions tests/Functions/ST_3DShortestLineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ protected function setUp(): void

/**
* @group postgis-3.0
* @group versioned
*/
public function testQuery1(): void
{
Expand Down Expand Up @@ -80,6 +81,10 @@ public function testQuery1(): void

/**
* @group postgis-3.1
* @group postgis-3.2
* @group postgis-3.3
* @group postgis-3.4
* @group versioned
*/
public function testQuery2(): void
{
Expand Down
Loading
Loading