Skip to content
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

Merged
merged 1 commit into from Apr 14, 2020

Conversation

macalimlim
Copy link
Contributor

No description provided.

@macalimlim
Copy link
Contributor Author

this resolves issue #28

@macalimlim macalimlim force-pushed the replace-datadog-with-statsd branch 6 times, most recently from a15da03 to f19ef81 Compare April 6, 2020 04:58
test/ziggurat/config_test.clj Show resolved Hide resolved
src/ziggurat/metrics.clj Outdated Show resolved Hide resolved
@macalimlim macalimlim force-pushed the replace-datadog-with-statsd branch 2 times, most recently from a7d7120 to ef20a8a Compare April 6, 2020 14:34
(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]
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@macalimlim macalimlim force-pushed the replace-datadog-with-statsd branch 2 times, most recently from 2399877 to 589b833 Compare April 8, 2020 04:12
@macalimlim macalimlim merged commit 76cd9eb into gojek:master Apr 14, 2020
@macalimlim macalimlim deleted the replace-datadog-with-statsd branch April 14, 2020 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants