-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Stubbing of requests does not work #835
Comments
Can you provide a stack trace? I can't reproduce this error on my end. |
Failure/Error: s3 = Aws::S3::Client.new(stub_responses: true)
stub_request(:get, "http://169.254.169.254/latest/meta-data/iam/security-credentials/"). |
This looks like a failure when trying to pull from the instance profile credentials, which I'm still not able to recreate. If you can tell me what version of the SDK you're using, that could be helpful. Taking a look in the meantime. |
We can see that the stub_responses client is accessing the credential provider chain, which shouldn't happen at all. We're looking in to that. |
The Our tests are not picking them up because we apply the following in our spec helper: RSpec.configure do |config|
config.before(:each) do
# disable instance profile credentials
path = '/latest/meta-data/iam/security-credentials/'
stub_request(:get, "http://169.254.169.254#{path}").to_raise(SocketError)
end
end The solution is pretty simple. The SDK needs to apply the stub responses plugin after the request signing plugin so that it has precedence on setting the default credentials option. |
@trevorrowe That seems to have fixed most of it. Thanks so much! |
I've fixed this in the SDK now. When you set |
I have a call to:
and I immediately get a
WebMock::NetConnectNotAllowedError
. Thoughts?The text was updated successfully, but these errors were encountered: