This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-20
Channels
- # 100-days-of-code (2)
- # aleph (53)
- # architecture (2)
- # aws (3)
- # beginners (230)
- # boot (15)
- # calva (3)
- # cider (19)
- # cljs-dev (1)
- # clojure (139)
- # clojure-conj (3)
- # clojure-italy (47)
- # clojure-nl (19)
- # clojure-spec (26)
- # clojure-uk (98)
- # clojurescript (152)
- # clojutre (4)
- # core-async (22)
- # cursive (5)
- # datomic (48)
- # emacs (11)
- # events (1)
- # figwheel-main (219)
- # fulcro (15)
- # instaparse (3)
- # jobs (4)
- # jobs-rus (1)
- # leiningen (30)
- # luminus (8)
- # off-topic (67)
- # onyx (5)
- # pedestal (16)
- # re-frame (1)
- # reagent (4)
- # reitit (31)
- # ring (8)
- # ring-swagger (3)
- # shadow-cljs (115)
- # specter (4)
- # videos (1)
- # vim (20)
- # yada (15)
We have some integration tests that use configuration from the :test
profile.
Now I want to run these tests from the REPL (Cider).
What's a reasonable way to do it?
Ideally, I'd run a single REPL and use :test
config values only for tests but I guess there's no easy way how to do it.
All sorts of things, mostly 3rd party credentials and database connection config. For me the db connection config is the critical thing I would say - because tests delete all data before they are run.
Right, but I think I'll get only the config values associated with active profile which normally, in my case, is :dev
.
So I guess I need to run another REPL with the :test
profile, right?
The problem is that we have the same keys (e.g. db connection string) in both profiles and they have different values depending on which profile is active (`:dev` or :test
).
I'm just curious what people usually do in this situation.
No, that's not the case - in my case, :test
is run only for lein test
(https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#task-specific-profiles)
But the resource I linked mentions this :-D > Please note that putting things in the :test profile is strongly advised against as it can result in tests which can't be run from the repl.
but I’m not sure what you want to do in your case: you want the lein repl
to have visibility into both values for the config at the same time?
Yeah, I'm really not sure. I guess I cannot expect both profiles to work at the same time. I'll need to think how to configure my tests so that they use different database and are still runnable from the REPL
if you used a different config lib, like say juxt/aero
, you can have the various config under :profile
s