pelias / whosonfirst

Importer for Who's on First gazetteer
MIT License
26 stars 42 forks source link

unit tests dependant on default pelias.json values #521

Closed missinglink closed 4 months ago

missinglink commented 3 years ago

I noticed today that when I have my own local ~/pelias.json file with values in import.whosonfirst then the tests fail. Moving or deleting ~/pelias.json make the tests pass again.

I didn't dig into it further but I'm guessing that having countryCode: US set is what's causing the issue..

    "whosonfirst": {
      "datapath": "/data/wof/sqlite",
      "sqlite": true,
      "importPostalcodes":false,
      "countryCode": "US",
      "importPlace": ["85633793"]
    }

see: https://github.com/pelias/whosonfirst/pull/520

orangejulius commented 3 years ago

Ah yeah, I might have seen this at some point too. If not in this repo, I'm pretty sure it's possible in others.

I think the easiest way around this sort of problem is to always use an empty pelias.json when running the tests, like we did in https://github.com/pelias/api/pull/1431. It's not much work to set up, and it doesn't require going through all the unit tests to find which ones might possibly behave differently with non-standard pelias.json settings.