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
replace datadog key with statsd key in the config #148
replace datadog key with statsd key in the config #148
Conversation
this resolves issue #28 |
a15da03
to
f19ef81
Compare
a7d7120
to
ef20a8a
Compare
(let [config-filename "config.test.edn" | ||
config-values-from-env (config-from-env config-filename)] | ||
(with-redefs [config-from-env (fn [_] config-values-from-env) | ||
config-file config-filename] |
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.
Hey michael, can you help me understand how redefining a config-file here is helping us?
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.
I apologize in advance if my explanation is not clear, but I will do my best. The test is getting configurations from 2 different sources, from "config.test.edn" (as provided in the test) and "config.edn" (as per line 12 of config.clj. in our test, config.edn does not exist. but regardless it exists or not, it get merged with the default-config) then you are comparing them (the config you got from config-from-env and the config we got from the function in test, in this case statsd-config). Redefining config-file in the test ensures that it only gets the configuration from 1 source (whichever config file that was provided to the test). There are cases that the configuration (thru the config file that is provided to the test) is different from what we got from the merged config (config.edn + default-config). The best example of this are the test cases for the datadog/statsd.
2399877
to
589b833
Compare
589b833
to
e83a531
Compare
No description provided.