Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ruby/lib/ci/queue/redis/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def stop_heartbeat!
end

def custom_config
return unless config.debug_log
return {} unless config.debug_log

require 'logger'
{ debug_log: Logger.new(config.debug_log) }
Expand Down
12 changes: 12 additions & 0 deletions ruby/test/ci/queue/redis_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,18 @@ def test_initialise_from_rediss_uri
assert_instance_of CI::Queue::Redis::Worker, queue
end

def test_custom_config_returns_empty_hash_by_default
queue = worker(1)
custom_config = queue.send(:custom_config)
assert_equal({}, custom_config)
end

def test_custom_config_returns_logger_when_debug_log_is_set
queue = worker(1, debug_log: '/dev/null')
custom_config = queue.send(:custom_config)
assert_kind_of Logger, custom_config[:debug_log]
end

private

def shuffled_test_list
Expand Down
Loading