This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-27
Channels
- # announcements (2)
- # beginners (69)
- # boot (2)
- # calva (15)
- # cider (4)
- # cljs-dev (8)
- # cljsrn (1)
- # clojure (38)
- # clojure-spec (2)
- # clojure-uk (6)
- # clojurescript (6)
- # cursive (12)
- # data-science (1)
- # datomic (6)
- # emacs (10)
- # figwheel-main (12)
- # fulcro (41)
- # nrepl (1)
- # re-frame (16)
- # reitit (1)
- # shadow-cljs (6)
- # spacemacs (2)
- # speculative (1)
- # test-check (9)
Do you guys use any external stateful things like a database (Redis) or do you create simulators for all of it? Lets say you want to create property based tests for a sequence of function calls that uses Redis.
I was thinking of just having a redis-test-instance and then I will "Clean" it after all tests are done running.
yeah you'd want to effectively reset the database as part of your trial
I've certainly done that before you can find bugs in your database that way 🙂
but having to reset something in a different process can definitely lead to fairly slow tests, so you have to have some tolerance for that
a year (maybe two?) ago we switched out the redis library we used at work, and I took all the operations we did using an old redis library and defined them as a protocol, then implemented that protocol on a concurrent hashmap and on the new redis library, then I wrote the thunderdome, which would take a generated list of redis operations and two things that satisfied the redis protocol and run those operations against them comparing the results.
https://github.com/advancedtelematic/quickcheck-state-machine is super interesting
@hiredman did you find bugs in redis?
I did not, I wasn't really exercising redis, the kind of api layer I pulled out, we aren't (weren't?) using redis all that much, but I wanted to make sure the operations behaved the same when moving from a higher level library (lots of built in serialization magic) to a lower level library (doing all the serialization ourselves). I think the protocol I ended up defining to encapsulate our redis use was maybe 4 functions