Sha256: d2afb46cd376dbf4fa29b10dfc8f78d054602795fd2fcd0efd5c47fb3dffbecf

Contents?: true

Size: 1.56 KB

Versions: 271

Compression:

Stored size: 1.56 KB

Contents

#
# Fluentd
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
#

require 'test/unit'
require 'fluent/env' # for Fluent.windows?
require 'fluent/test/log'
require 'fluent/test/base'
require 'fluent/test/input_test'
require 'fluent/test/output_test'
require 'fluent/test/filter_test'
require 'fluent/test/parser_test'
require 'fluent/test/formatter_test'
require 'serverengine'


module Fluent
  module Test
    def self.dummy_logger
      dl_opts = {log_level: ServerEngine::DaemonLogger::INFO}
      logdev = Fluent::Test::DummyLogDevice.new
      logger = ServerEngine::DaemonLogger.new(logdev, dl_opts)
      Fluent::Log.new(logger)
    end

    def self.setup
      ENV['SERVERENGINE_WORKER_ID'] = '0'

      $log = dummy_logger

      Fluent.__send__(:remove_const, :Engine)
      engine = Fluent.const_set(:Engine, EngineClass.new).init(SystemConfig.new)

      engine.define_singleton_method(:now=) {|n|
        @now = n
      }
      engine.define_singleton_method(:now) {
        @now ||= super()
      }

      nil
    end
  end
end

$log ||= Fluent::Test.dummy_logger

Version data entries

271 entries across 271 versions & 8 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/lib/fluent/test.rb
fluentd-1.16.6-x86-mingw32 lib/fluent/test.rb
fluentd-1.16.6-x64-mingw32 lib/fluent/test.rb
fluentd-1.16.6-x64-mingw-ucrt lib/fluent/test.rb
fluentd-1.16.6 lib/fluent/test.rb
fluentd-1.17.1-x86-mingw32 lib/fluent/test.rb
fluentd-1.17.1-x64-mingw32 lib/fluent/test.rb
fluentd-1.17.1-x64-mingw-ucrt lib/fluent/test.rb
fluentd-1.17.1 lib/fluent/test.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/lib/fluent/test.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/lib/fluent/test.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/lib/fluent/test.rb
fluentd-1.17.0-x86-mingw32 lib/fluent/test.rb
fluentd-1.17.0-x64-mingw-ucrt lib/fluent/test.rb
fluentd-1.17.0-x64-mingw32 lib/fluent/test.rb
fluentd-1.17.0 lib/fluent/test.rb
fluentd-1.16.5-x64-mingw-ucrt lib/fluent/test.rb
fluentd-1.16.5-x86-mingw32 lib/fluent/test.rb
fluentd-1.16.5-x64-mingw32 lib/fluent/test.rb
fluentd-1.16.5 lib/fluent/test.rb