weavejester / environ

Library for managing environment variables in Clojure
924 stars 71 forks source link

lein test merges test into dev? #89

Closed dsbw closed 5 years ago

dsbw commented 5 years ago

I'm sure I must be missing something somewhere, but I discovered the following using a new app, using environ and lein-environ 1.1.0. With the following profiles.clj:

{:dev  {:env {:somevar "dev" :somevar2 "dev3"}}
 :test {:env {:somevar "test"}}}

When I "lein run", .lein-env is:

{:somevar "dev", :somevar2 "dev3"}

When I "lein test", .lein-env is:

{:somevar "test", :somevar2 "dev3"}

But I don't see where in the docs (or in the code for that matter :-() dev gets merged into test. I can't unset a dev-set variable, either, like:

{:dev  {:env {:somevar "dev" :somevar2 "dev3"}}
 :test {:env {:somevar "test" :somevar2 nil}}}

I'm chasing down a more complex setup but this definitely threw me for a loop!

weavejester commented 5 years ago

What you're seeing is how Leiningen's profiles work. See the Leiningen documentation on profiles for more information.

dsbw commented 5 years ago

Thanks! I figured I was just looking in the wrong place.