# # Fluentd Kubernetes Output Plugin - Enrich Fluentd events with Kubernetes # metadata # # Copyright 2015 Red Hat, Inc. # # 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 "simplecov" require "codeclimate-test-reporter" if ENV['CIRCLE_ARTIFACTS'] dir = File.join("..", "..", "..", ENV['CIRCLE_ARTIFACTS'], "coverage") SimpleCov.coverage_dir(dir) end SimpleCov.add_filter 'vendor' SimpleCov.start do formatter SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter, CodeClimate::TestReporter::Formatter ] end begin require "bundler" rescue LoadError => e STDERR.puts e.message STDERR.puts "Run `gem install bundler` to install Bundler." exit e.status_code end begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e $stderr.puts e.message $stderr.puts "Run `bundle install` to install missing gems" exit e.status_code end require 'minitest/spec' require 'minitest/autorun' require 'minitest/benchmark' $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'fluent/test' unless ENV.has_key?('VERBOSE') nulllogger = Object.new nulllogger.instance_eval {|obj| def method_missing(method, *args) # pass end } $log = nulllogger end require "minispec-metadata" require "vcr" require "minitest-vcr" require "webmock" VCR.configure do |c| c.cassette_library_dir = 'test/cassettes' c.hook_into :excon, :webmock c.filter_sensitive_data('') { Docker.url.sub(/tcp\:/, 'https:') } c.ignore_hosts 'codeclimate.com' end MinitestVcr::Spec.configure! require 'fluent/plugin/out_kubernetes'