Skip to content

Commit

Permalink
[test] Added test to cover monitoring to be enabled only when legacy.…
Browse files Browse the repository at this point in the history
…monitoring is overridden
  • Loading branch information
andsel committed Oct 21, 2024
1 parent 6bd75a6 commit 8fd24d2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions x-pack/spec/monitoring/pipeline_register_hook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
}

context 'validate monitoring settings' do
it "it's not enabled with just xpack.monitoring.enabled set to true" do
expect(subject.monitoring_enabled?(settings)).to be_falsey
end

context 'when legacy.monitoring is overridden' do
let(:settings) { super().merge({"legacy.monitoring.enabled" => true}) }

it "should be enabled" do
expect(subject.monitoring_enabled?(settings)).to be_truthy
end
end

it "work without any monitoring settings" do
settings.set_value("xpack.monitoring.enabled", true)
expect(subject.generate_pipeline_config(settings)).to be_truthy
Expand Down

0 comments on commit 8fd24d2

Please sign in to comment.