graphhopper / geocoder-converter

Converts arbitrary geocoding responses to a GraphHopper response
https://graphhopper.com/api/1/docs/geocoding/#external-providers
Apache License 2.0
9 stars 11 forks source link

Gisgraphy tests fail due to missing key #48

Open karussell opened 6 years ago

karussell commented 6 years ago

We could put our API key for gisgraphy in the hidden section here at github, but highly likely it will be exposed in the logging. Or should we temporary disable gisgraphy tests for travis?

gisgraphy commented 6 years ago

I suggest using the demo server https://services.gisgraphy.com/

karussell commented 6 years ago

It would still fail:

testHandleReverse(com.graphhopper.converter.resource.ConverterResourceGisgraphyTest): expected:<[2]00> but was:<[4]00>
testHandleForward(com.graphhopper.converter.resource.ConverterResourceGisgraphyTest): expected:<[2]00> but was:<[4]00>
gisgraphy commented 6 years ago

I suggest that you put a user-agent that I accept on server side on the demo server, as I have done on this PR : https://github.com/DenisCarriere/geocoder/pull/348/commits/a0248e374022003b869535e8515a2a2a78ca6356

what about 'geocoder-converter'

karussell commented 6 years ago

Ok

gisgraphy commented 6 years ago

Please add a user agent only for tests (something like a variable only feed in tests) I don t want to white list all the users of the geocoder converter 😊

boldtrn commented 6 years ago

Please add a user agent only for tests (something like a variable only feed in tests) I don t want to white list all the users of the geocoder converter blush

Wouldn't it be easier to create a very limited key for this purpose? Changing the user-agent is a possible solution, but since we make this transparent, every user could just switch to the geocoding-converter user agent as well.

Anyway changing the user agent just for tests seems to be not straight forward. We could add a config variable to change the user-agent (maybe we do this globally for all providers or only gisgraphy). Then we would set geocoder-converter as user-agent in the test converter.yml. This also requires a change of ConverterResourceGisgraphy where we add the user-agent to every request to the server. This means that also production requests get a user-agent (can be different from the test user-agent though).

gisgraphy commented 6 years ago

That 's I got in mind too :-). Just put a user-agent different for the tests.

what about 'geocoder-converter' for the "main software" and 'geocoder-converter' for tests?