forked from fluent/fluent-plugin-s3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
106 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
|
||
Release 0.2.0 - 2011/10/16 | ||
|
||
* Updated to fluentd-0.10.0 | ||
|
||
|
||
Release 0.1.1 - 2011/09/27 | ||
|
||
* First release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.2 | ||
0.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,49 @@ | ||
# Generated by jeweler | ||
# DO NOT EDIT THIS FILE DIRECTLY | ||
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' | ||
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command | ||
# -*- encoding: utf-8 -*- | ||
|
||
Gem::Specification.new do |s| | ||
s.name = %q{fluent-plugin-s3} | ||
s.version = "0.1.2" | ||
s.version = "0.2.0" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
s.authors = ["Sadayuki Furuhashi"] | ||
s.date = %q{2011-10-06} | ||
s.date = %q{2011-10-16} | ||
s.email = %q{[email protected]} | ||
s.extra_rdoc_files = [ | ||
"ChangeLog", | ||
"README.rdoc" | ||
"README.rdoc" | ||
] | ||
s.files = [ | ||
"AUTHORS", | ||
"Rakefile", | ||
"VERSION", | ||
"lib/fluent/plugin/out_s3.rb" | ||
"Rakefile", | ||
"VERSION", | ||
"lib/fluent/plugin/out_s3.rb", | ||
"test/out_s3.rb" | ||
] | ||
s.homepage = %q{http://fluent.github.com/} | ||
s.rdoc_options = ["--charset=UTF-8"] | ||
s.require_paths = ["lib"] | ||
s.rubygems_version = %q{1.3.7} | ||
s.summary = %q{Amazon S3 output plugin for Fluent event collector} | ||
s.test_files = [ | ||
"test/out_s3.rb" | ||
] | ||
|
||
if s.respond_to? :specification_version then | ||
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION | ||
s.specification_version = 3 | ||
|
||
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then | ||
s.add_runtime_dependency(%q<fluent>, ["~> 0.9.14"]) | ||
s.add_runtime_dependency(%q<fluentd>, ["~> 0.10.0"]) | ||
s.add_runtime_dependency(%q<aws-sdk>, ["~> 1.1.3"]) | ||
else | ||
s.add_dependency(%q<fluent>, ["~> 0.9.14"]) | ||
s.add_dependency(%q<fluentd>, ["~> 0.10.0"]) | ||
s.add_dependency(%q<aws-sdk>, ["~> 1.1.3"]) | ||
end | ||
else | ||
s.add_dependency(%q<fluent>, ["~> 0.9.14"]) | ||
s.add_dependency(%q<fluentd>, ["~> 0.10.0"]) | ||
s.add_dependency(%q<aws-sdk>, ["~> 1.1.3"]) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
require 'fluent/test' | ||
require 'fluent/plugin/out_s3' | ||
|
||
class S3OutputTest < Test::Unit::TestCase | ||
def setup | ||
Fluent::Test.setup | ||
end | ||
|
||
CONFIG = %[ | ||
aws_key_id test_key_id | ||
aws_sec_key test_sec_key | ||
s3_bucket test_bucket | ||
path log | ||
utc | ||
buffer_type memory | ||
] | ||
|
||
def create_driver(conf = CONFIG) | ||
Fluent::Test::BufferedOutputTestDriver.new(Fluent::S3Output) do | ||
def write(chunk) | ||
chunk.read | ||
end | ||
end.configure(conf) | ||
end | ||
|
||
def test_configure | ||
d = create_driver | ||
assert_equal 'test_key_id', d.instance.aws_key_id | ||
assert_equal 'test_sec_key', d.instance.aws_sec_key | ||
assert_equal 'test_bucket', d.instance.s3_bucket | ||
assert_equal 'log', d.instance.path | ||
end | ||
|
||
def test_format | ||
d = create_driver | ||
|
||
time = Time.parse("2011-01-02 13:14:15 UTC").to_i | ||
d.emit({"a"=>1}, time) | ||
d.emit({"a"=>2}, time) | ||
|
||
d.expect_format %[2011-01-02T13:14:15Z\ttest\t{"a":1}\n] | ||
d.expect_format %[2011-01-02T13:14:15Z\ttest\t{"a":2}\n] | ||
|
||
d.run | ||
end | ||
|
||
def test_write | ||
d = create_driver | ||
|
||
time = Time.parse("2011-01-02 13:14:15 UTC").to_i | ||
d.emit({"a"=>1}, time) | ||
d.emit({"a"=>2}, time) | ||
|
||
# S3OutputTest#write returns chunk.read | ||
data = d.run | ||
|
||
assert_equal %[2011-01-02T13:14:15Z\ttest\t{"a":1}\n] + | ||
%[2011-01-02T13:14:15Z\ttest\t{"a":2}\n], | ||
data | ||
end | ||
|
||
end | ||
|