jacekschae / learn-reitit-course-files

🎦 Learn Reitit course files for building Cheffy REST API
https://www.learnreitit.com
37 stars 16 forks source link

Cannot run tests at end of lesson 33 token fixture: Uncaught exception, not in assertion. #3

Closed jennet closed 3 years ago

jennet commented 3 years ago

Upon completing lesson 33 Token Fixture, the tests do not run successfully, although they do in the video.

The error in the REPL is:

ERROR in (recipe-test) (PgPreparedStatement.java:480)
Uncaught exception, not in assertion.
expected: nil
  actual: org.postgresql.util.PSQLException: No hstore extension installed.
 at org.postgresql.jdbc.PgPreparedStatement.setMap (PgPreparedStatement.java:480)
    org.postgresql.jdbc.PgPreparedStatement.setObject (PgPreparedStatement.java:965)
    next.jdbc.prepare$eval4567$fn__4568.invokePrim (prepare.clj:45)
    next.jdbc.prepare$eval4567$fn__4568.invoke (prepare.clj:-1)
    next.jdbc.prepare$eval4542$fn__4543$G__4533__4552.invoke (prepare.clj:32)
    next.jdbc.prepare$set_parameters.invokeStatic (prepare.clj:58)
    next.jdbc.prepare$set_parameters.invoke (prepare.clj:51)
    next.jdbc.prepare$create.invokeStatic (prepare.clj:147)
    next.jdbc.prepare$create.invoke (prepare.clj:86)
    next.jdbc.result_set$eval5552$fn__5560.invoke (result_set.clj:865)
    next.jdbc.protocols$eval4236$fn__4267$G__4227__4276.invoke (protocols.clj:33)
    next.jdbc$execute_BANG_.invokeStatic (jdbc.clj:241)
    next.jdbc$execute_BANG_.invoke (jdbc.clj:225)
    next.jdbc.sql$find_by_keys.invokeStatic (sql.clj:109)
    next.jdbc.sql$find_by_keys.invoke (sql.clj:78)
    next.jdbc.sql$find_by_keys.invokeStatic (sql.clj:106)
    next.jdbc.sql$find_by_keys.invoke (sql.clj:78)

Following the lessons, the first thought it usually that I must have made a mistake following the instructions, so I take a lot of time to redo the steps and check for typos and errors before starting to assume that there is instead a mistake in the video.

jennet commented 3 years ago

Found what I thought was the problem at https://github.com/jacekschae/learn-reitit-course-files/blob/master/increments/36-step/test/cheffy/test_system.clj#L22

EDIT - actually even with this I'm still getting an exception, I'll update here once I've continued with the following lessons long enough to find what the full answer could be

jennet commented 3 years ago

I thought I best post this in the issues list in case someone else runs into the same problem. It would also be useful to have the exception and fix mentioned in the description of lesson 33.

jennet commented 3 years ago

Found the other change needed to get this to work. https://github.com/jacekschae/learn-reitit-course-files/blob/master/increments/36-step/src/cheffy/middleware.clj#L22

The discovery/explanation/fix is at 15 mins into Lesson 35

jacekschae commented 3 years ago

Thanks for the feedback. Will include the description of video 33

jacekschae commented 3 years ago

Just added the info to lesson 33