metabase / toucan

A classy high-level Clojure library for defining application models and retrieving them from a DB
Eclipse Public License 1.0
569 stars 49 forks source link

Update! does not work with non-integer ids #20

Closed AndreTheHunter closed 6 years ago

AndreTheHunter commented 6 years ago

@camsaul

When testing my application I get at java.lang.AssertionError: Assert failed: (integer? id) for toucan.db/update!. The :pre condition assumes the id is integer, however we use UUIDs.

I've created a PR: https://github.com/metabase/toucan/pull/19

Also, I can not run the tests locally. I get a org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was provided. error. I think a local testing db is needed (a toucan_test database?). I'd recommend setting up a global fixture that creates the db if required.

Also, switch to CircleCI 2.0 https://circleci.com/docs/2.0/migrating-from-1-2/, then the same docker container used for the testing database could be run locally.

camsaul commented 6 years ago

Merged your PR. Thanks for the contribution!

camsaul commented 6 years ago

@AndreTheHunter I went ahead and tweaked the test code as well so you can configure the DB connection https://github.com/metabase/toucan#tests--linting

You should be able to run tests locally now