ex-aws / ex_aws

A flexible, easy to use set of clients AWS APIs for Elixir
https://hex.pm/packages/ex_aws
MIT License
1.26k stars 521 forks source link

Remove warnings in test environment #893

Closed prodis closed 1 year ago

prodis commented 2 years ago

It removes the following warnings when running the tests:

warning: use Mix.Config is deprecated. Use the Config module instead
  config/config.exs:1

warning: use Mix.Config is deprecated. Use the Config module instead
  config/test.exs:1

warning: variable "opts" is unused (if the variable is not meant to be used, prefix it with an underscore)
  test/ex_aws/instance_meta_test.exs:80: ExAws.InstanceMetaTest."test IMDSv2 when initial metadata request fails with a 401, fallback to IMDSv2 flow"/1

warning: variable "opts" is unused (if the variable is not meant to be used, prefix it with an underscore)
  test/ex_aws/instance_meta_test.exs:104: ExAws.InstanceMetaTest."test IMDSv2 configuration to use IMDSv2 by default"/1
bernardd commented 2 years ago

Nice one, thanks @prodis! Those have been bugging me for a while, I just never had a moment to fix them.

bernardd commented 2 years ago

Hrm. Those CI errors are probably not your fault. I'm gonna have to look at them later when I have a moment.

bernardd commented 2 years ago

Oh right. the issue is that the Config module didn't actually exist prior to 1.10, and ExAws still officially supports back to 1.7. There are probably magic macros you can use to work around that, and at some point in the not too distant future I'll probably drop support for them, but for now that change does break support for older versions.

prodis commented 2 years ago

I see. An alternative is to check the Elixir version in the config files and use the compatible approach.

@bernardd Let me know if you agree and I can do it.

bernardd commented 2 years ago

Hey, sorry for the delay - minor case of Covid over here. Yes, that would be fine too if you're happy to go with that solution. Cheers.

bernardd commented 1 year ago

I think this is resolved now that I've bumped the minimum version to 1.10. Thanks for the contribution @prodis.