Skip to content

Commit

Permalink
add tests for replication with schema use
Browse files Browse the repository at this point in the history
  • Loading branch information
lonvia committed Sep 30, 2024
1 parent b30d7e2 commit 9b16c43
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions tests/bdd/command-line/replication_schema.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Feature: Tests for the osm2pgsql-replication script with schemas

Scenario: Replication updates work on database with schema
Given the input file 'liechtenstein-2013-08-03.osm.pbf'
And the database schema foobar
And the replication service at http://example.com/europe/liechtenstein-updates
| sequence | timestamp |
| 9999999 | 2013-08-01T01:00:02Z |
| 10000000 | 2013-09-01T01:00:00Z |
| 10000001 | 2013-10-01T01:00:00Z |
When running osm2pgsql pgsql with parameters
| --slim | --schema | foobar |
And running osm2pgsql-replication
| init | --schema | foobar |
And running osm2pgsql-replication
| update | --schema | foobar |

Then table foobar.osm2pgsql_properties contains
| property | value |
| replication_base_url | http://example.com/europe/liechtenstein-updates |
| replication_sequence_number | 10000001 |
| replication_timestamp | 2013-10-01T01:00:00Z |


Scenario: Replication updates work on database with different middle schema
Given the input file 'liechtenstein-2013-08-03.osm.pbf'
And the database schema foobar
And the replication service at http://example.com/europe/liechtenstein-updates
| sequence | timestamp |
| 9999999 | 2013-08-01T01:00:02Z |
| 10000000 | 2013-09-01T01:00:00Z |
| 10000001 | 2013-10-01T01:00:00Z |
When running osm2pgsql pgsql with parameters
| --slim | --middle-schema | foobar |
And running osm2pgsql-replication
| init | --middle-schema | foobar |
And running osm2pgsql-replication
| update | --middle-schema | foobar |

Then table foobar.osm2pgsql_properties contains
| property | value |
| replication_base_url | http://example.com/europe/liechtenstein-updates |
| replication_sequence_number | 10000001 |
| replication_timestamp | 2013-10-01T01:00:00Z |


Scenario: Replication updates work on database with middle schema different from schema
Given the input file 'liechtenstein-2013-08-03.osm.pbf'
And the database schema foobar
And the database schema baz
And the replication service at http://example.com/europe/liechtenstein-updates
| sequence | timestamp |
| 9999999 | 2013-08-01T01:00:02Z |
| 10000000 | 2013-09-01T01:00:00Z |
| 10000001 | 2013-10-01T01:00:00Z |
When running osm2pgsql pgsql with parameters
| --slim | --middle-schema | foobar | --schema | baz |
And running osm2pgsql-replication
| init | --middle-schema | foobar | --schema | baz |
And running osm2pgsql-replication
| update | --middle-schema | foobar | --schema | baz |

Then table foobar.osm2pgsql_properties contains
| property | value |
| replication_base_url | http://example.com/europe/liechtenstein-updates |
| replication_sequence_number | 10000001 |
| replication_timestamp | 2013-10-01T01:00:00Z |

0 comments on commit 9b16c43

Please sign in to comment.