Sha256: a91e32d6f7259086180f1e9230b4718e8a0e83677b7f7f4088aec68566b852b1

Contents?: true

Size: 1.18 KB

Versions: 26

Compression:

Stored size: 1.18 KB

Contents

require 'helper'
require 'fluent/plugin/in_kubernetes_metrics.rb'

class KubernetesMetricsInputTest < Test::Unit::TestCase
  include Fluent::Test::Helpers
  include PluginTestHelper

  @@driver = nil
  
  CONFIG = %(
      type kubernetes_metrics
      node_name generics-aws-node-name
      tag kube.*
      insecure_ssl true
      interval 10s
      use_rest_client true
      use_rest_client_ssl false
      kubelet_port 10_255
      kubelet_address generics-aws-node-name
  ).freeze

  setup do
    Fluent::Test.setup
  end

  def create_driver(conf = CONFIG)
    Fluent::Test::Driver::Input.new(Fluent::Plugin::KubernetesMetricsInput).configure(conf)
  end

  test 'timestamps_missing' do
    @@parsed_unit_string = JSON.parse(get_unit_parsed_string_missing_timestamps)
    ENV['KUBERNETES_SERVICE_HOST'] = k8s_host
    ENV['KUBERNETES_SERVICE_PORT'] = k8s_port
    # all stub response bodies are from real k8s 1.8 API calls
    stub_k8s_api
    stub_kubelet_summary_api_missing_timestamps
    stub_k8s_v1
    stub_kubelet_summary_api_missing_timestamps
    stub_metrics_cadvisor
    stub_metrics_stats
    @@driver = create_driver
    @@driver.run timeout: 20, expect_emits: 1, shutdown: true
  end
end

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
hbrewster-fluent-plugin-kubernetes-metrics-1.1.7 test/plugin/test_missing_timestamps.rb
hbrewster-fluent-plugin-kubernetes-metrics-1.1.6 test/plugin/test_missing_timestamps.rb
fluent-plugin-kubernetes-metrics-1.1.6 test/plugin/test_missing_timestamps.rb
fluent-plugin-kubernetes-metrics-1.1.5 test/plugin/test_missing_timestamps.rb
fluent-plugin-kubernetes-metrics-1.1.4 test/plugin/test_missing_timestamps.rb
fluent-plugin-kubernetes-metrics-1.1.2 test/plugin/test_missing_timestamps.rb