Skip to content

Failing BANO geocoder test #2798

Closed

Description

@irees

Expected behavior

Test against external BANO geocoder matches query string

Observed behavior

Response is "55 Rue du Faubourg Saint-Honore" instead of "55 Rue du Faubourg Saint-Honoré"

Version of OTP used (exact commit hash or JAR name)

4513d7e

Data sets in use (links to GTFS and OSM PBF files)

N/A

Command line used to start OTP

N/A

Router config and graph build config JSON

N/A

Steps to reproduce the problem

N/A

Activity

  1. added
    X OTP1~ Not in use any more ~ Fix or backport to the 1.x version of OTP
    on Jul 30, 2019
  2. t2gran commented on Jul 30, 2019

    @t2gran
    Member

    @ekorsky @abyrd I added the fix/PR from OTP1 to OTP2, but I changed the test slightly - the test fails if there is no internet connection(false positive). I added an "assumeConnectedToInternet()" in the test. The test is ignored if there is no internet connection.

  3. abyrd commented on Jul 30, 2019

    @abyrd
    Member

    Thanks @t2gran. I'm wondering though whether we should have any tests that rely on having an internet connection, and rely on an external service producing output. This is as much a test of the BANO service itself (and the entire internet between the build machine and that service) as it is a test of OTP. Really that external service should be mocked up.

    I understand that you've made this less problematic by disabling the test when there's no internet connection, but that still feels strange to me - if the OTP component was broken, we could get a false test pass just by the network connection accidentally dropping. It seems like bad form overall.

  4. t2gran commented on Jul 30, 2019

    @t2gran
    Member

    I see it as an integration test, verifying that the API do not change and exist. The installations of OTP that uses this geocoder will probably notice that something is wrong long before any accidental unit tests are run - so I support removing it or mocking the external service.

  5. drewda commented on Jul 30, 2019

    @drewda
    Contributor

    @t2gran @abyrd for other projects (not in Java), we use libraries to record external service requests (to a YAML or JSON file that's checked into the repo); the library then creates a mock for the test, playing back the stored response.

  6. abyrd commented on Jul 31, 2019

    @abyrd
    Member

    We talked about replacing it with a test fixture file and mocking the external service, and I started looking into it. But when considering what that mock should look like, I realized this will make the test pretty self-referential, and it will no longer really test anything. A mocked service that always returns the same address doesn't verify that the URL being constructed is compatible with the current version of the API out on the web, nor the interaction between the bounding box and the search string, etc.

    I'm going to just apply @t2gran's fix from #2800.

  7. added this to the 2.0 milestone on Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    X OTP1~ Not in use any more ~ Fix or backport to the 1.x version of OTP

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions