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

update S3 SDK + fix region access in tests #305

Merged
merged 1 commit into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fluent-plugin-s3.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Gem::Specification.new do |gem|
gem.require_paths = ['lib']

gem.add_dependency "fluentd", [">= 0.14.22", "< 2"]
gem.add_dependency "aws-sdk-s3", "~> 1.0"
gem.add_dependency "aws-sdk-sqs", "~> 1.0"
gem.add_dependency "aws-sdk-s3", "~> 1.60"
gem.add_dependency "aws-sdk-sqs", "~> 1.23"
gem.add_development_dependency "rake", ">= 0.9.2"
gem.add_development_dependency "test-unit", ">= 3.0.8"
gem.add_development_dependency "test-unit-rr", ">= 1.0.3"
Expand Down
2 changes: 2 additions & 0 deletions test/test_in_s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
require 'test/unit/rr'
require 'zlib'
require 'fileutils'
require 'ostruct'

include Fluent::Test::Helpers

Expand Down Expand Up @@ -152,6 +153,7 @@ def test_sqs_endpoint_with_invalid_endpoint(endpoint)

def setup_mocks
@s3_client = stub(Aws::S3::Client.new(stub_responses: true))
stub(@s3_client).config { OpenStruct.new({region: "us-east-1"}) }
mock(Aws::S3::Client).new(anything).at_least(0) { @s3_client }
@s3_resource = mock(Aws::S3::Resource.new(client: @s3_client))
mock(Aws::S3::Resource).new(client: @s3_client) { @s3_resource }
Expand Down
3 changes: 3 additions & 0 deletions test/test_out_s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
require 'fileutils'
require 'timecop'
require 'uuidtools'
require 'ostruct'

include Fluent::Test::Helpers

Expand Down Expand Up @@ -427,6 +428,7 @@ def initialize(data)

def setup_mocks(exists_return = false)
@s3_client = stub(Aws::S3::Client.new(stub_responses: true))
stub(@s3_client).config { OpenStruct.new({region: "us-east-1"}) }
# aws-sdk-s3 calls Client#put_object inside Object#put
mock(@s3_client).put_object(anything).at_least(0) { MockResponse.new({}) }
mock(Aws::S3::Client).new(anything).at_least(0) { @s3_client }
Expand Down Expand Up @@ -464,6 +466,7 @@ def setup_s3_object_mocks(params = {})

def setup_mocks_hardened_policy()
@s3_client = stub(Aws::S3::Client.new(:stub_responses => true))
stub(@s3_client).config { OpenStruct.new({region: "us-east-1"}) }
mock(@s3_client).put_object(anything).at_least(0) { MockResponse.new({}) }
mock(Aws::S3::Client).new(anything).at_least(0) { @s3_client }
@s3_resource = mock(Aws::S3::Resource.new(:client => @s3_client))
Expand Down