Sha256: 4907795f8eb5788cf9ed95fa3278673b5ba992de5e972a1bd29550659757c9fc

Contents?: true

Size: 923 Bytes

Versions: 37

Compression:

Stored size: 923 Bytes

Contents

require 'spec_helper'
require 'fluent/plugin/in_prometheus_tail_monitor'
require 'fluent/test/driver/input'

describe Fluent::Plugin::PrometheusTailMonitorInput do
  MONITOR_CONFIG = %[
  @type prometheus_tail_monitor
  <labels>
    host ${hostname}
    foo bar
  </labels>
]

  INVALID_MONITOR_CONFIG = %[
  @type prometheus_tail_monitor

  <labels>
    host ${hostname}
    foo bar
    invalid_use1 $.foo.bar
    invalid_use2 $[0][1]
  </labels>
]

  let(:config) { MONITOR_CONFIG }
  let(:driver) { Fluent::Test::Driver::Input.new(Fluent::Plugin::PrometheusTailMonitorInput).configure(config) }

  describe '#configure' do
    describe 'valid' do
      it 'does not raise error' do
        expect { driver }.not_to raise_error
      end
    end

    describe 'invalid' do
      let(:config) { INVALID_MONITOR_CONFIG }
      it 'expect raise error' do
        expect { driver }.to raise_error
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 4 rubygems

Version Path
fluent-plugin-prometheus-2.2.0 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-2.1.0 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
phihos-fluent-plugin-prometheus-2.0.3.pre.1 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
phihos-fluent-plugin-prometheus-2.0.3 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-2.0.3 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-2.0.2 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-2.0.1 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-2.0.0 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-1.8.5 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-1.8.4 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-1.8.3 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-1.8.2 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-1.8.1 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-1.8.0 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.23 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.22 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.21 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.20 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.19 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.18 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb