Skip to content

boot-environ/environ weird precedence #65

@st

Description

@st

In a new project, let's create this task:

(deftask run-tests
  []
  (comp
    (environ :env {:config-path "path-test.edn"})
    (test)))

and add this test

(deftest environ-precendence  
  (is (= "path-test.edn" (environ/env :config-path))))

It works fine until environment variable CONFIG_PATH is declared.

$ export CONFIG_PATH=path-prod
...
FAIL in (environ-precendence) (core_test.clj:8)
expected: "path-test.edn"
  actual: "path-prod"
    diff: - "path-test.edn"
          + "path-prod"

Shouldn't binding in deftask (environ :env {:config-path "path-test.edn"}) have precedence over environment variable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions