Closed paulrd closed 8 years ago
lein ancient upgrade :all :check-clojure
[selmer "1.0.2"] is available but we use "1.0.0"
[org.webjars/jquery "2.2.1"] is available but we use "2.2.0"
[compojure "1.5.0"] is available but we use "1.4.0"
[ring/ring-defaults "0.2.0"] is available but we use "0.1.5"
[luminus-nrepl "0.1.4"] is available but we use "0.1.3"
[conman "0.4.6"] is available but we use "0.4.5"
[luminus-immutant "0.1.9"] is available but we use "0.1.3"
Tests seem to pass after this. But! Are tests supposed to be idempotent?
lein test
[2016-03-12 18:30:41,719][DEBUG][org.jboss.logging] Logging Provider: org.jboss.logging.Log4jLoggerProvider
lein test guestbook.test.db.core
[2016-03-12 18:30:42,717][INFO][com.zaxxer.hikari.HikariDataSource] HikariPool-0 - is starting.
[2016-03-12 18:30:42,919][INFO][migratus.core] Starting migrations
[2016-03-12 18:30:42,962][INFO][migratus.core] Ending migrations
lein test :only guestbook.test.db.core/test-users
FAIL in (test-users) (core.clj:26)
expected: [{:name "test",
:message "test",
:timestamp #inst "2016-03-13T01:30:42.967-00:00",
:id 1}]
actual: ({:id 2,
:name "test",
:message "test",
:timestamp #inst "2016-03-13T01:30:42.967000000-00:00"})
diff: - [{:id 1}]
+ [{:id 2}]
lein test guestbook.test.handler
Ran 2 tests containing 5 assertions.
1 failures, 0 errors.
Tests failed.
Yeah, looks like 0.1.3
didn't get published, and the problem in the tests is that H2 doesn't rollback sequences. So, the id keeps incrementing.
I've updated the sample code to the latest, and fixed the test to be idempotent.