Skip to content

Commit

Permalink
Ignore features ordering in test (#1675)
Browse files Browse the repository at this point in the history
Try to fix #1651 
- [x] Ignore `*.pbf` as the features ordering has changed
- [x] Use `ogrmerge of gdal` to generate the description text of `*.pbf`
files
- [x] Add "gid" to `function_Mixed_Name.sql` for `jq` sorting 
- [x] Upgrade to PostGIS:15-3.4
- [x] Add verification of gdal-bin in `test.sh` 
- [x] Just bless
- [x] Update doc
  • Loading branch information
sharkAndshark authored Feb 2, 2025
1 parent 31b781c commit 6984f3a
Show file tree
Hide file tree
Showing 91 changed files with 16,300 additions and 4,862 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
PGPASSWORD: postgres
services:
postgres:
image: postgis/postgis:14-3.3
image: postgis/postgis:15-3.4
ports:
# will assign a random free host port
- 5432/tcp
Expand All @@ -46,7 +46,7 @@ jobs:
--health-timeout 5s
--health-retries 5
--entrypoint sh
postgis/postgis:14-3.3
postgis/postgis:15-3.4
-c "exec docker-entrypoint.sh postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key"
steps:
- uses: taiki-e/install-action@v2
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
# TODO: aarch64-unknown-linux-gnu
services:
postgres:
image: postgis/postgis:14-3.3
image: postgis/postgis:15-3.4
ports:
- 5432/tcp
options: >-
Expand All @@ -104,7 +104,7 @@ jobs:
--health-timeout 5s
--health-retries 5
--entrypoint sh
postgis/postgis:14-3.3
postgis/postgis:15-3.4
-c "exec docker-entrypoint.sh postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key"
steps:
Expand All @@ -126,6 +126,8 @@ jobs:
# https://github.com/docker/setup-qemu-action
with:
platforms: linux/amd64,linux/arm64
- name: Set up gdal-bin
run: sudo apt-get install -y gdal-bin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# https://github.com/docker/setup-buildx-action
Expand Down Expand Up @@ -348,7 +350,7 @@ jobs:
if: matrix.os == 'windows-latest'
uses: nyurik/[email protected]
id: pg
with: { username: 'postgres', password: 'postgres', database: 'test',postgres-version: 14, port: 34837, postgis_version: 3.3.3}
with: { username: 'postgres', password: 'postgres', database: 'test',postgres-version: 15, port: 34837, postgis_version: 3.4.2}
- name: Install and run Postgis (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
Expand All @@ -364,7 +366,7 @@ jobs:
--health-interval=10s \
--health-timeout=5s \
--health-retries=5 \
postgis/postgis:14-3.3 \
postgis/postgis:15-3.4 \
postgres \
-c ssl=on \
-c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem \
Expand All @@ -385,14 +387,16 @@ jobs:
export PGSERVICE="${{ steps.pg.outputs.service-name }}"
fi
tests/fixtures/initdb.sh
- name: Copy static files
run: cp -r tests/fixtures/pmtiles2/* ${{ steps.nginx.outputs.html-dir }}
- name: Download build artifact build-${{ matrix.target }}
uses: actions/download-artifact@v4
with:
name: build-${{ matrix.target }}
path: target/
- name: Set up gdal-bin
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y gdal-bin
- name: Integration Tests
run: |
export MARTIN_BUILD_ALL=-
Expand All @@ -410,7 +414,7 @@ jobs:
tests/test.sh
- name: Compare test output results (Linux)
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: diff --brief --recursive --new-file tests/output tests/expected
run: diff --brief --recursive --new-file --exclude='*.pbf' tests/output tests/expected
- name: Download Debian package (Linux)
if: matrix.target == 'x86_64-unknown-linux-gnu'
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -450,11 +454,11 @@ jobs:
- img_ver: 11-3.0-alpine
args: postgres
sslmode: disable
- img_ver: 14-3.3-alpine
- img_ver: 15-3.4-alpine
args: postgres
sslmode: disable
# alpine images don't support SSL, so for this we use the debian images
- img_ver: 14-3.3
- img_ver: 15-3.4
args: postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
sslmode: require
#
Expand Down Expand Up @@ -517,6 +521,8 @@ jobs:
with:
name: build-x86_64-unknown-linux-gnu
path: target_releases/
- name: Install gdal-bin
run: sudo apt-get install -y gdal-bin
- name: Integration Tests
run: |
if [[ "${{ matrix.sslmode }}" == "verify-ca" || "${{ matrix.sslmode }}" == "verify-full" ]]; then
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:

db-is-ready:
# This should match the version of postgres used in the CI workflow
image: postgis/postgis:14-3.3-alpine
image: postgis/postgis:15-3.4-alpine
network_mode: host
command:
- 'sh'
Expand All @@ -25,7 +25,7 @@ services:

db:
# This should match the version of postgres used in the CI workflow
image: postgis/postgis:14-3.3-alpine
image: postgis/postgis:15-3.4-alpine
restart: unless-stopped
ports:
- '${PGPORT:-5411}:5432'
Expand All @@ -47,7 +47,7 @@ services:

db-ssl:
# This should match the version of postgres used in the CI workflow
image: postgis/postgis:14-3.3
image: postgis/postgis:15-3.4
command:
- 'postgres'
- '-c'
Expand Down Expand Up @@ -75,7 +75,7 @@ services:

db-ssl-cert:
# This should match the version of postgres used in the CI workflow
image: postgis/postgis:14-3.3
image: postgis/postgis:15-3.4
command:
- 'postgres'
- '-c'
Expand Down
2 changes: 1 addition & 1 deletion docs/src/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Install a few required libs and tools:

```bash, ignore
# For Ubuntu-based distros
sudo apt install -y build-essential pkg-config jq file
sudo apt install -y build-essential pkg-config jq file gdal-bin
```

Install [Just](https://github.com/casey/just#readme) (improved makefile processor). Note that some Linux and Homebrew
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ test-int: clean-test install-sqlx
echo "** Skipping diffing with the expected output"
else
echo "** Comparing actual output with expected output..."
if ! diff --brief --recursive --new-file tests/output tests/expected; then
if ! diff --brief --recursive --new-file --exclude='*.pbf' tests/output tests/expected; then
echo "** Expected output does not match actual output"
echo "** If this is expected, run 'just bless' to update expected output"
exit 1
Expand Down
Binary file modified tests/expected/auto/cmp_0_0_0.pbf
Binary file not shown.
Loading

0 comments on commit 6984f3a

Please sign in to comment.