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-smarter-1.8.17 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.16 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.15 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.14 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.13 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.12 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.11 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.10 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.9 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.8 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.7 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.6 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-test-1.7.1 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-test-1.7.0 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.5 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-smarter-1.8.4 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb
fluent-plugin-prometheus-1.7.3 spec/fluent/plugin/in_prometheus_tail_monitor_spec.rb