cognitect-labs / aws-api

AWS, data driven

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing test?

NoahTheDuke opened this issue · comments

When I run the tests locally, I see a failure at the line below. The tests pass if I add :region "us-east-1" to the client map. I am not super familiar with the library, so my apologies if this is due to dev misconfiguration.

(let [client (aws/client {:api :s3})

Hi @NoahTheDuke

Super-short answer: for me, the default region is picked up from my ~/.aws/config file, which has a line indicating the default region.

Slightly longer answer: if a :region is not explicitly passed to the aws client function, then as the docstring indicates the region will be gotten from the default region provider. Which is a chained provider, and the "profile region provider" (third in the chain) will look for a default region in your AWS configuration profile file (~/.aws/config by default).

commented

Thanks for the explanation. Should the tests pass that so they aren't reliant on external configuration?

@NoahTheDuke I see your point, I'll reopen the issue. Yes ideally api-test unit test shouldn't pass or fail based on an external thing like the default region provider, which depends on the user's environment. And then maybe we're missing a test that fails if the default region provider fails to find a region - that would better alert the user to what the problem is.