-
Notifications
You must be signed in to change notification settings - Fork 151
Refactoring and cleaning of the S3 outputs #1
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
Conversation
|
Does this fix elastic/logstash#1528, also? |
|
yes it also fix elastic/logstash#1528 |
|
@ph please remove the "Gemfile.orig" from the PR :) |
|
Good catch @jsvd ! |
|
Can anyone estimate when will this be merged? |
gemspec to require stud 0.0.18 adding integration test for s3
spec/outputs/s3_spec.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a matter of style, but this two lines could be generalized using using let statements.
|
As a general comment on the specs, I would enforce the idea of using more the power of subjects, something like what we can see http://www.relishapp.com/rspec/rspec-core/v/2-11/docs/subject/explicit-subject#subject-in-top-level-group, what do you think? |
|
@purbon I have added the tests to ensure we don't lose any events when doing the file rotation. |
lib/logstash/outputs/s3.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a timestamp for this temp file name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After thinking, this would make sure the check works if something goes wrong.
I'll add it.
lib/logstash/outputs/s3.rb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe move this to the outside of the if, since it will be called either way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as this test are using a real S3 for testing, they should go into the integration part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well they test if the file rotation is done locally and we don't drop events when creating new files. Not sure why this local test would require a real S3 connection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It requires a local connection for me, you should probably mock the connection parts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do more testing, the AWS.stub! at https://github.com/logstash-plugins/logstash-output-s3/pull/1/files#diff-14cf776b93312a411664cdaf9463b8b3R14 should mock all the connections made from the aws-sdk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not in this case, at less for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a note:
The call was mocked, but the S3 settings were not explicitly set in the config for the test.
The aws_mixin has multiples fallback and it was picking the config in my environment.
|
Merged sucessfully into master! |
… gemspec to require stud 0.0.18 adding integration test for s3 Fixes #1
This PRs includes a lot of changes.