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

Test instructions #6

Closed
rupurt opened this issue Nov 22, 2017 · 4 comments
Closed

Test instructions #6

rupurt opened this issue Nov 22, 2017 · 4 comments

Comments

@rupurt
Copy link
Contributor

rupurt commented Nov 22, 2017

Howdy,

What's your recommendation for getting started testing this package? I had to manually change config/config.exs and use System.get_env("NAME") instead of {:system, "NAME"}. Is that the expected approach or am I missing something?

@bnhansn
Copy link
Owner

bnhansn commented Nov 26, 2017

Hey @rupurt what error were you getting when running tests? I just realized that if System variables were not used then this package would throw error (ArgumentError) non-alphabet digit found: "_" because of an issue with decoding the api secret. I supplied a fix here #8 and tried to make the different environment configurations more explicit.

I use System.get_env("NAME") instead of {:system, "NAME"}, but either approach should work. Let me know if #8 fixes the issue or if you get another error when running tests.

@rupurt
Copy link
Contributor Author

rupurt commented Nov 27, 2017

Hey @bnhansn,

I was getting the same error because {:system, "NAME"} wasn't reading anything in for me. I'm pretty new to Elixir so I'm not really sure why. Once I changed it to System.get_env("NAME") it worked fine.

Fwiw I have a .env file for each environment e.g. .env.test, .env.production, .env.development and source the file for the environment I need.

@bnhansn
Copy link
Owner

bnhansn commented Nov 27, 2017

I don't usually use .env files with elixir so I haven't tested that here, I set the values in my ~/.bash_profile. Anyways since System.get_env is working, I'll close the issue, but anyone is free to open it if the {:system, "xxx"} approach is not working and can provide more information. Thanks.

@bnhansn bnhansn closed this as completed Nov 27, 2017
@rupurt
Copy link
Contributor Author

rupurt commented Nov 27, 2017

@bnhansn so after reading the code in https://github.com/bnhansn/ex_gdax/blob/master/lib/ex_gdax/config.ex I understand what is happening. I thought {:system, "GDAX_API_KEY"} was a special way to read environment variables but "GDAX_API_KEY" is just literally the key, LOL!!

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

No branches or pull requests

2 participants