Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: remove shared param validation tests #383

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions spec/classes/broker_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require 'spec_helper'
require 'shared_examples_param_validation'

describe 'kafka::broker', type: :class do
on_supported_os.each do |os, os_facts|
Expand All @@ -18,11 +17,18 @@
}
end

it { is_expected.to compile }
it { is_expected.to contain_class('kafka::broker::install').that_comes_before('Class[kafka::broker::config]') }
it { is_expected.to contain_class('kafka::broker::config').that_comes_before('Class[kafka::broker::service]') }
it { is_expected.to contain_class('kafka::broker::service').that_comes_before('Class[kafka::broker]') }
it { is_expected.to contain_class('kafka::broker') }

context 'with invalid mirror_url' do
let(:params) { { 'mirror_url' => 'invalid' } }

it { is_expected.not_to compile }
end

context 'with manage_log4j => true' do
let(:params) { { 'manage_log4j' => true } }

Expand Down Expand Up @@ -95,8 +101,6 @@
it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_notify('Service[kafka]') }
end
end

it_validates_parameter 'mirror_url'
end
end
end
10 changes: 7 additions & 3 deletions spec/classes/consumer_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require 'spec_helper'
require 'shared_examples_param_validation'

describe 'kafka::consumer', type: :class do
on_supported_os.each do |os, os_facts|
Expand All @@ -19,11 +18,18 @@
}
end

it { is_expected.to compile }
it { is_expected.to contain_class('kafka::consumer::install').that_comes_before('Class[kafka::consumer::config]') }
it { is_expected.to contain_class('kafka::consumer::config').that_comes_before('Class[kafka::consumer::service]') }
it { is_expected.to contain_class('kafka::consumer::service').that_comes_before('Class[kafka::consumer]') }
it { is_expected.to contain_class('kafka::consumer') }

context 'with invalid mirror_url' do
let(:params) { { 'mirror_url' => 'invalid' } }

it { is_expected.not_to compile }
end

context 'with manage_log4j => true' do
let(:params) { { 'manage_log4j' => true } }

Expand Down Expand Up @@ -55,8 +61,6 @@
it { is_expected.to contain_service('kafka-consumer') }
end
end

it_validates_parameter 'mirror_url'
end
end
end
10 changes: 7 additions & 3 deletions spec/classes/mirror_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require 'spec_helper'
require 'shared_examples_param_validation'

describe 'kafka::mirror', type: :class do
on_supported_os.each do |os, os_facts|
Expand All @@ -22,11 +21,18 @@
}
end

it { is_expected.to compile }
it { is_expected.to contain_class('kafka::mirror::install').that_comes_before('Class[kafka::mirror::config]') }
it { is_expected.to contain_class('kafka::mirror::config').that_comes_before('Class[kafka::mirror::service]') }
it { is_expected.to contain_class('kafka::mirror::service').that_comes_before('Class[kafka::mirror]') }
it { is_expected.to contain_class('kafka::mirror') }

context 'with invalid mirror_url' do
let(:params) { { 'mirror_url' => 'invalid' } }

it { is_expected.not_to compile }
end

context 'with manage_log4j => true' do
let(:params) { { 'manage_log4j' => true } }

Expand All @@ -52,8 +58,6 @@
it { is_expected.to contain_service('kafka-mirror') }
end
end

it_validates_parameter 'mirror_url'
end
end
end
1 change: 0 additions & 1 deletion spec/classes/producer_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require 'spec_helper'
require 'shared_examples_param_validation'

describe 'kafka::producer', type: :class do
on_supported_os.each do |os, os_facts|
Expand Down
62 changes: 0 additions & 62 deletions spec/shared_examples_param_validation.rb

This file was deleted.

Loading