This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-11
Channels
- # aws (2)
- # babashka (11)
- # beginners (107)
- # calva (6)
- # cljsrn (18)
- # clojure (180)
- # clojure-australia (6)
- # clojure-europe (54)
- # clojure-losangeles (9)
- # clojure-nl (4)
- # clojure-uk (13)
- # clojureladies (1)
- # clojurescript (57)
- # clojureverse-ops (1)
- # consultantsdirectory (1)
- # cursive (48)
- # datomic (11)
- # defnpodcast (3)
- # degree9 (1)
- # deps-new (5)
- # depstar (21)
- # docker (2)
- # fulcro (15)
- # helix (32)
- # kaocha (1)
- # lsp (21)
- # malli (15)
- # meander (15)
- # news-and-articles (2)
- # nextjournal (1)
- # off-topic (42)
- # pathom (3)
- # podcasts (1)
- # polylith (73)
- # protojure (1)
- # re-frame (43)
- # reagent (1)
- # releases (1)
- # restql (1)
- # schema (1)
- # sci (1)
- # shadow-cljs (23)
- # spacemacs (7)
- # sql (5)
- # tools-deps (42)
- # vim (15)
- # xtdb (3)
I’ll be getting my second jab today. I am dreading the side-effects since everyone seems to get severe side-effects the second time.
Ok, I’m hoping that’s what’s in store (that’s what happened for the first jab), but seems like most people are down with a fever for 1-2 days when they get the second pfizer/moderna shot.
Morning
Same as @mpenet for me
I had a pretty rough reaction to Moderna #2 but an elderly friend of ours who had initially resisted getting the vaccine altogether because of "horrible allergies" had zero reaction whatsoever. YMMV.
Morning Clojurians! Woke up with a question in mind - which library would you suggest for testing api endpoints? 😶🌫️
@chokheli Do you mean writing tests to verify an HTTP-based service "works"? We just use clojure.test
or expectations.clojure.test
and write expected behaviors (results) for a variety of HTTP calls. One of the areas where we're pretty religious about TDD, rather than just "writing tests for code".
use-fixtures :once (fn [f] (wmk/wiremock-fixture {:port wiremock-port} f)))
(defexpect filter-agreements
(let [request (str "/associations/v1/query")]
(expecting
"valid association should keep policy in policies"
(wmk/with-stubs
[{:req [:POST request] :res [200 {:body (utils/map->string policy)}]}]
(expect policy (filter-for-valid-agreement policies to app-config))))
...
...
(is a little example, of using wiremock to return a response based upon a request).
If you're mocking the service, you're not actually testing the API endpoint tho'...?
if you're testing your own internal APIs, then I do what you do, I just write expecations.
I guess we'll have to wait and see what Giga means 🙂
Morning! @simongray I got nothing but a sore shoulder from my second shot.
For testing our api-endpoints, we’ve made some stuff inspired by Page Objects, and in that way got a lot of http-specific noise away from our tests:
(api/deftest basic-sanity-tests
;; These are basic sanity tests and not a replacement for real
;; integration tests
(api/as :org-admin
(api/create-group {:name "My group"})
(let [groups (api/groups)
g (first (filter (comp #{"My group"} :name) groups))
user-id (core/id (api/current-user))]
(testing "Writer can't create groups, or delete existing ones"
(api/as :writer
(api/has-status? 403 (api/create-group {:name "Bad"}))
(api/has-status? 403 (api/delete-group (core/id g)))))
(testing "Basic group operations"
(api/update-group (assoc g :name "Foobar"))
(is (= "Foobar" (:name (api/group (core/id g)))))
(api/update-group-users (core/id g) :add {:userIds [user-id]})
(api/delete-group (core/id g))
(api/has-status? 404 (api/group (core/id g)))
(is (= (dec (count groups))
(count (api/groups))))))))
so api/create-group
executes an http-request under the hood, and asserts (since it’s a create that we get a 201 (I believe) status code, otherwise it fails the test.IMO this makes for tests that are fairly easy to write, and most importantly, quite easy to read, at least compared to what we had before.
morning! @simongray just a slightly sore arm here as well
Good morning 😎
måning! @simongray i got a day's mild fever starting about 12hrs after the second moderna shot
After both jabs my arm was sore for 36 hours. I don’t know if “sore” is the right word, I usually use it to describe normal after-workout muscle pain, but in this case it was pretty painful (could not use the arm to lift anything heavier than a mug)
Are you sure? It's a big place
@raymcdermott Yeah, some of the comments are golden 🙂
It got picked up by the Medium email curators and sent to all the Data Science types I think
Like Medium isn't already full of click-bait-y titles... :face_with_rolling_eyes:
That is priceless @U0K1RLM99! 🙂
(heavily "clapped" so it reaches -- and annoys -- even more people!)
@U0ETXRFEW That was my favourite comment, he got a very long reply 🙂
@U04V70XH6 It had to be done, odd that I got so much love and hate, when the same kind of titles with pointless snake oil don’t get as much pushback. So I wrote this 🙂
It is unclear to me, whether these steps must be followed in that precise order and if I should repeat ad nauseam until success. I suggest selling a "1M/YR Data Science and ML Mastery" video course that will go into the nitty gritty details that can't be explained in a 3-point Medium article and be well on your way to millions yourself. Looking forward to the upselling email newsletter!