Skip to content

Commit 6a6c3c0

Browse files
ddukbgdaipom
andauthored
test: Add tests for Zstd compression level configuration
Add test cases to verify: - Default compression level (3) - Custom compression level setting Co-authored-by: Daijiro Fukuda <[email protected]>
1 parent 904a043 commit 6a6c3c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/test_out_s3.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,16 @@ def test_configure_with_mime_type_lzo
109109
assert(e.is_a?(Fluent::ConfigError))
110110
end
111111

112-
def test_configure_with_mime_type_zstd
112+
data('level default' => nil,
113+
'level 1' => 1)
114+
def test_configure_with_mime_type_zstd(level)
113115
conf = CONFIG.clone
114116
conf << "\nstore_as zstd\n"
117+
conf << "\n<compress>\nlevel #{level}\n</compress>\n" if level
115118
d = create_driver(conf)
116119
assert_equal 'zst', d.instance.instance_variable_get(:@compressor).ext
117120
assert_equal 'application/x-zst', d.instance.instance_variable_get(:@compressor).content_type
121+
assert_equal (level || 3), d.instance.instance_variable_get(:@compressor).instance_variable_get(:@compress_config).level
118122
end
119123

120124
def test_configure_with_path_style

0 commit comments

Comments
 (0)