[Tile-serving] [openstreetmap/osm2pgsql] Convert some tests for the flex output to BDD-style tests (PR #1678)

Sarah Hoffmann notifications at github.com
Sat May 28 12:48:12 UTC 2022


The BDD tests offer different means to check database content, so the conversion is not exactly 1:1 but tries to follow the intention of the tests. There is one commit per converted tests to make review easier. @joto please check if the tests still do what they are supposed to do.

Two new BDD phrases have been introduced:
* If 'exactly' is added to a 'table ... contains' test, then the table must contain exactly the given rows and will error out if there are too many tables. Duplicate entries work fine. You have to add duplicate entries in the table. (Remember that rows are only compared on the expected columns. If the table has other columns, then they are ignored.)
* Geometry comparison is now possible for 'table .. contains'. Trigger a comparison by using the ST_AsText() function around the expected column. Geometries need to be given in the format [explained in GeometryFactory](https://github.com/openstreetmap/osm2pgsql/blob/eea72d8868015d5a7f3bca48df2cd99f1c6e2feb/tests/bdd/steps/geometry_factory.py#L20). For an example see the bbox test.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/1678

-- Commit Summary --

  * move test-output-flex-attr to BDD
  * convert test-output-flex-bbox to BDD tests
  * convert test-output-flex-cluster to BDD test
  * convert test-output-flex-invalid-geom to BDD test
  * convert test-output-flex-line to BDD test

-- File Changes --

    M tests/CMakeLists.txt (5)
    A tests/bdd/flex/bbox.feature (68)
    A tests/bdd/flex/extra_attributes.feature (71)
    A tests/bdd/flex/invalid_geometries.feature (126)
    A tests/bdd/flex/line_spliiting.feature (50)
    A tests/bdd/flex/nocluster.feature (44)
    M tests/bdd/steps/steps_db.py (74)
    D tests/data/test_output_flex_attr.lua (20)
    D tests/data/test_output_flex_bbox.lua (40)
    D tests/data/test_output_flex_invalid_geom.lua (45)
    D tests/data/test_output_flex_line.lua (24)
    D tests/data/test_output_flex_nocluster.lua (29)
    D tests/test-output-flex-attr.cpp (87)
    D tests/test-output-flex-bbox.cpp (78)
    D tests/test-output-flex-cluster.cpp (28)
    D tests/test-output-flex-invalid-geom.cpp (101)
    D tests/test-output-flex-line.cpp (45)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/1678.patch
https://github.com/openstreetmap/osm2pgsql/pull/1678.diff

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

Message ID: <openstreetmap/osm2pgsql/pull/1678 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20220528/69efb3e7/attachment.htm>


More information about the Tile-serving mailing list