linz / gazetteer

New Zealand Gazetteer of official place names
http://www.linz.govt.nz/regulatory/place-names/find-name/new-zealand-gazetteer-official-geographic-names/new-zealand-gazetteer-search-place-names#zoom=0&lat=-41.14127&lon=172.5&layers=BTTT
Other
2 stars 2 forks source link

Add database schema test and associated rule #183

Closed strk closed 4 years ago

strk commented 4 years ago

Fixes: #181

strk commented 4 years ago

On github-actions I get the input device is not a TTY, rings a bell, but I don't remember how we fixed that in another case. @SPlanzer do you recall that message ?

SPlanzer commented 4 years ago

On github-actions I get the input device is not a TTY, rings a bell, but I don't remember how we fixed that in another case. @SPlanzer do you recall that message ?

Yeah sure do.

b303d7bbdd32fa0c7ed23509d9bf57ccb3bc280f got these passing

You also made changes to the QGIS prjects (qgis_testrunner.sh)[https://github.com/qgis/QGIS/blob/master/.docker/qgis_resources/test_runner/qgis_testrunner.sh]

strk commented 4 years ago

Unfortunately the error here is still the input device is not a TTY, nothing to do with the hanging, I've to figure out why pg_tap wants a TTY...

strk commented 4 years ago

It looks like adding -T switch to docker-compose exec fixes the TTY problem. Now to find out why the tests fail.

strk commented 4 years ago

Ok the failure was due to wrong assumption about where gaz_update_export_database function should be (test expected it in gazetteer_export schema, but in reality it is in gazetteer). I'm not sure where it shoudl be, as the CREATE FUNCTION is not qualified here:

src/sql/gazetteer_export_func.sql:CREATE OR REPLACE FUNCTION gaz_update_export_database()

There's a search_path set at the beginning of the file, which was changed by @SPlanzer in 0b43c3afd0ff2e4936d8627320d5ec3ea50e7995 to have gazetteer as the first schema, instead of gazetteer_export, which one would be more correct ?

Note the other error was name_export_for_lol being also in gazetteer schema, but maybe that one should also be in gazetteer_export ?

Anyway for now I made the tests pass with what we have..

strk commented 4 years ago

Ok I think we have a problem. The tests fail on my machine, as I invoke make docker-db-tests directly, from the starting docker images. But it succeeds here, so my impression is that some views/functions are created by precedent tests (qgis tests?). I suspect this is something that should not happen (leaving artifacts by the end of tests)

strk commented 4 years ago

Ok I was wrong, I just had to rebuild the docker image. Tests pass on my machine as well now.