[Tile-serving] [osm2pgsql-dev/osm2pgsql] Add script for style testing (PR #2436)

Sarah Hoffmann notifications at github.com
Tue Dec 2 18:50:09 UTC 2025


This adds the script osm2pgsql-test-style which allows blackbox testing of osm2pgsql lua styles. The script uses the same BDD test style as already introduced with osm2pgsql's integration tests. For details and documentation see: https://github.com/osm2pgsql-dev/osm2pgsql-website/pull/78

The PR also changes the internal tests to use the style tester. The semantics of the steps have slightly changed to make them more consistent and understandable. So there were some changes to the tests necessary, most notably:

* Failure/success of osm2pgsql execution is now tested in a separate step.
* Geometry comparisons no longer need the geometry to be wrapped in `ST_AsText()` but use the `!geo` matcher instead.
* The node grid now has it's origin in the lower left corner as one would ordinarily expect. That required turning the grid tables upside down for some tests that relied on nodes having certain coordinate values.

Note: the tester originally also changed the behaviour with respect to environment variables and ignored the ones set outside. However, it turns out that `pg_virtualenv` needs some `PG*` variables set to have osm2pgsql use the right cluster. And the Windows CI just refused to do such basic things like name resolution when some of its variables are unset. I've not further investigated but simply reinstated the previous behaviour of forwarding all environment variables.
You can view, comment on, or merge this pull request online at:

  https://github.com/osm2pgsql-dev/osm2pgsql/pull/2436

-- Commit Summary --

  * introduce osm2pgsql-test-style for BDD testing
  * add parameters for lua and themepark path
  * change BDD run script to new style tester
  * adapt test documentation for new runner
  * allow selected PG* env variables so that pg_virtualenv works
  * remove old behave harness
  * avoid run-test-bdd script in ctest
  * forward environment variables to osm2pgsql in test

-- File Changes --

    M .github/actions/win-install/action.yml (4)
    M CMakeLists.txt (4)
    M CONTRIBUTING.md (29)
    A scripts/osm2pgsql-test-style (833)
    M tests/CMakeLists.txt (5)
    D tests/bdd/.behaverc (3)
    M tests/bdd/command-line/invalid.feature (6)
    M tests/bdd/command-line/replication.feature (26)
    M tests/bdd/command-line/replication_legacy.feature (17)
    D tests/bdd/environment.py (156)
    M tests/bdd/flex/area.feature (6)
    M tests/bdd/flex/bbox.feature (18)
    M tests/bdd/flex/delete-callbacks.feature (6)
    M tests/bdd/flex/empty-insert.feature (4)
    M tests/bdd/flex/geometry-collection.feature (4)
    M tests/bdd/flex/geometry-function-area.feature (6)
    M tests/bdd/flex/geometry-iteration.feature (16)
    M tests/bdd/flex/geometry-linestring.feature (9)
    M tests/bdd/flex/geometry-multilinestring.feature (8)
    M tests/bdd/flex/geometry-multipoint.feature (10)
    M tests/bdd/flex/geometry-null.feature (18)
    M tests/bdd/flex/geometry-point.feature (44)
    M tests/bdd/flex/geometry-processing.feature (22)
    M tests/bdd/flex/invalid-geometries.feature (10)
    M tests/bdd/flex/invalid-lua.feature (3)
    M tests/bdd/flex/line-splitting.feature (8)
    M tests/bdd/flex/locator.feature (36)
    M tests/bdd/flex/lua-expire-output-definitions.feature (27)
    M tests/bdd/flex/lua-expire.feature (18)
    M tests/bdd/flex/lua-index-definitions.feature (61)
    M tests/bdd/flex/lua-table-definitions.feature (21)
    M tests/bdd/flex/multigeom.feature (2)
    M tests/bdd/flex/relation-changes.feature (2)
    M tests/bdd/flex/way-change.feature (2)
    M tests/bdd/regression/import.feature (55)
    M tests/bdd/regression/input.feature (2)
    M tests/bdd/regression/multipolygon.feature (266)
    M tests/bdd/regression/properties.feature (14)
    M tests/bdd/regression/update.feature (4)
    D tests/bdd/steps/geometry_factory.py (104)
    D tests/bdd/steps/replication_server_mock.py (53)
    D tests/bdd/steps/steps_db.py (340)
    D tests/bdd/steps/steps_execute.py (212)
    D tests/bdd/steps/steps_osm_data.py (54)
    A tests/run-bdd-tests.in (3)
    D tests/run-behave.in (10)

-- Patch Links --

https://github.com/osm2pgsql-dev/osm2pgsql/pull/2436.patch
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2436.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2436
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/pull/2436 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20251202/ce96db34/attachment.htm>


More information about the Tile-serving mailing list