Ensure it also works when configuring just log options without setting a driver

This commit is contained in:
Samuel Sieg
2023-03-24 09:38:02 +01:00
parent c3de89bb59
commit 9c27ead21f
5 changed files with 12 additions and 7 deletions

View File

@@ -213,9 +213,14 @@ class ConfigurationTest < ActiveSupport::TestCase
assert_equal ["--log-opt", "max-size=\"10m\""], @config.logging_args
end
test "logging args with custom config" do
test "logging args with configured options" do
config = Mrsk::Configuration.new(@deploy.tap { |c| c.merge!(logging: { "options" => { "max-size" => "100m", "max-file" => 5 } }) })
assert_equal ["--log-opt", "max-size=\"100m\"", "--log-opt", "max-file=\"5\""], @config.logging_args
end
test "logging args with configured driver and options" do
config = Mrsk::Configuration.new(@deploy.tap { |c| c.merge!(logging: { "driver" => "local", "options" => { "max-size" => "100m", "max-file" => 5 } }) })
assert_equal ["--log-driver", "local", "--log-opt", "max-size=\"100m\"", "--log-opt", "max-file=\"5\""], @config.logging_args
assert_equal ["--log-driver", "\"local\"", "--log-opt", "max-size=\"100m\"", "--log-opt", "max-file=\"5\""], @config.logging_args
end
test "erb evaluation of yml config" do