Skip to content

Commit

Permalink
test: Add tests for Zstd compression level configuration
Browse files Browse the repository at this point in the history
Add test cases to verify:
- Default compression level (3)
- Custom compression level setting

Co-authored-by: Daijiro Fukuda <[email protected]>
  • Loading branch information
ddukbg and daipom authored Nov 6, 2024
1 parent 904a043 commit 6a6c3c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/test_out_s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ def test_configure_with_mime_type_lzo
assert(e.is_a?(Fluent::ConfigError))
end

def test_configure_with_mime_type_zstd
data('level default' => nil,
'level 1' => 1)
def test_configure_with_mime_type_zstd(level)
conf = CONFIG.clone
conf << "\nstore_as zstd\n"
conf << "\n<compress>\nlevel #{level}\n</compress>\n" if level
d = create_driver(conf)
assert_equal 'zst', d.instance.instance_variable_get(:@compressor).ext
assert_equal 'application/x-zst', d.instance.instance_variable_get(:@compressor).content_type
assert_equal (level || 3), d.instance.instance_variable_get(:@compressor).instance_variable_get(:@compress_config).level
end

def test_configure_with_path_style
Expand Down

0 comments on commit 6a6c3c0

Please sign in to comment.