felt / geo

A collection of GIS functions for Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test specific configuration not documented?

bglusman opened this issue · comments

Hi @bryanjos , thanks for the awesome work on this library! It's been a smooth process using it so far, though admittedly I haven't done much yet.

I was trying to add acceptance tests to my prototype, snapshot in this branch: https://github.com/MasbiaSoupKitchenNetwork/open_pantry/tree/erroring_gis_specs

and though the geometry type is working fine in the app when running normally, it errors in the tests saying:

15:33:56.754 [error] Postgrex.Protocol (#PID<0.577.0>) disconnected: ** (RuntimeError) type `geometry` can not be handled by the configured extensions
15:33:56.811 [error] #PID<0.716.0> running OpenPantry.Endpoint terminated
Server: localhost:4001 (http)
Request: GET /en/food_selections
** (exit) an exception was raised:
    ** (RuntimeError) type `geometry` can not be handled by the configured extensions
        (ecto) lib/ecto/adapters/postgres/connection.ex:86: Ecto.Adapters.Postgres.Connection.prepare_execute/5
        (ecto) lib/ecto/adapters/sql.ex:243: Ecto.Adapters.SQL.sql_call/6
        (ecto) lib/ecto/adapters/sql.ex:431: Ecto.Adapters.SQL.execute_and_cache/7
        (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
        (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
        (elixir) lib/enum.ex:1229: Enum."-map/2-lists^map/1-0-"/2
        (open_pantry) web/controllers/food_selection_controller.ex:8: OpenPantry.FoodSelectionController.index/2
        (open_pantry) web/controllers/food_selection_controller.ex:1: OpenPantry.FoodSelectionController.action/2
        (open_pantry) web/controllers/food_selection_controller.ex:1: OpenPantry.FoodSelectionController.phoenix_controller_pipeline/2
        (open_pantry) lib/open_pantry/endpoint.ex:1: OpenPantry.Endpoint.instrument/4
        (open_pantry) lib/phoenix/router.ex:261: OpenPantry.Router.dispatch/2
        (open_pantry) web/router.ex:1: OpenPantry.Router.do_call/2
        (open_pantry) lib/open_pantry/endpoint.ex:1: OpenPantry.Endpoint.phoenix_pipeline/1
        (open_pantry) lib/open_pantry/endpoint.ex:1: OpenPantry.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4

I thought maybe my Postgrex.Types definition was not being loaded somehow, so tried adding that to test_helper, but it warns that's being redefined and wasn't helping, and I poked around but couldn't think of what else could be the issue. For now I may just comment out that type from the schema as it's not really being actively used/relied upon for current funtionality, and is mostly a future-support feature/fun opportunity to play with PostGIS and your Geo library, but if anyone has any guidance on what issue might be, it would be appreciated!

Hi, I made a PR to your repo that I think should resolve the issue. openpantry/open_pantry#9

Ahh, of course! I knew there was something I s forgetting, if I'd set up tests more quickly would have remembered myself, thanks Bryan, sorry for stupidity!

No worries :)