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

Determine HTTPoison module at compile time #41

Merged
merged 1 commit into from
Jun 6, 2021

Conversation

jtormey
Copy link
Contributor

@jtormey jtormey commented Jun 3, 2021

Follow up from #37.

Moving this check to a module attribute means it will be executed at compile time, which removes the need for adding mix to :extra_applications in mix.exs.

All tests pass, and the module is determined correctly based on env:

elixir-auth-google $ mix run -e "IO.inspect ElixirAuthGoogle.inject_poison()"
HTTPoison
elixir-auth-google $ MIX_ENV=test mix run -e "IO.inspect ElixirAuthGoogle.inject_poison()"
ElixirAuthGoogle.HTTPoisonMock

@nelsonic
Copy link
Member

nelsonic commented Jun 4, 2021

Hi @jtormey, the code you've added looks like it should work. 🤔
Need to investigate why the build doesn't pass when back at my desk ... https://travis-ci.com/github/dwyl/elixir-auth-google/builds/227901294#L289

@nelsonic
Copy link
Member

nelsonic commented Jun 6, 2021

Checked out @jtormey's branch and the tests pass on localhost: ✅
image

I think we could merge this PR and confirm that it will pass on main. 💭

@nelsonic nelsonic merged commit c3a8323 into dwyl:main Jun 6, 2021
@nelsonic
Copy link
Member

nelsonic commented Jun 6, 2021

@nelsonic
Copy link
Member

nelsonic commented Jun 6, 2021

Thanks again @jtormey 🚀

@nelsonic nelsonic mentioned this pull request Jun 6, 2021
@jtormey jtormey deleted the fix-runtime-mix-env branch June 7, 2021 15:42
@SimonLab SimonLab mentioned this pull request Oct 11, 2021
3 tasks
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.

2 participants