-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow :env to be configurable from env variables #80
Conversation
f2a56c2
to
645ea63
Compare
@zorbash, any idea what's going on with those test failures? |
645ea63
to
676ff65
Compare
test/elixometer_test.exs
Outdated
original_env = Application.get_env(:elixometer, :env) | ||
Application.put_env(:elixometer, :env, {:system, "ELIXOMETER_MISSING_ENV"}) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no more than 1 consecutive blank lines.
676ff65
to
4699850
Compare
I had to add: to ensure cleanup even when an assertion fails and
|
test/elixometer_test.exs
Outdated
|
||
assert get_metric_value("elixometer.spirals.precomputed_counter", :one) == {:ok, 123} | ||
|
||
Application.put_env(:elixometer, :env, original_env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to do this in both the tests and in the on_exit
callback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's in the on_exit
callback it's no longer needed in the tests. Removing ✂️ .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
In your config/config.exs you can set {:system, "ENV_VARIABLE"} to allow the env to be set with environmental variables supplied on runtime. ``` config :elixometer, env: {:system, "ELIXOMETER_ENV"} ```
4699850
to
a6ea1c9
Compare
Looks good, @zorbash! Could you also mention this in the |
47814b9
to
973227b
Compare
@jparise I added a mention. |
Thanks! |
In your config/config.exs you can set {:system, "ENV_VARIABLE_HERE"} to allow the
env to be set with environmental variables supplied on runtime.